diff --git a/aws/cf/agent.cf.json b/aws/cf/agent.cf.json
new file mode 100644
index 0000000..7de4bd0
--- /dev/null
+++ b/aws/cf/agent.cf.json
@@ -0,0 +1,316 @@
+{
+ "AWSTemplateFormatVersion": "2010-09-09",
+ "Description": "Create a stack that runs Chroma hosted on a single instance",
+ "Parameters": {
+ "KeyName": {
+ "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
+ "Type": "String",
+ "ConstraintDescription": "If present, must be the name of an existing EC2 KeyPair.",
+ "Default": ""
+ },
+ "InstanceType": {
+ "Description": "EC2 instance type",
+ "Type": "String",
+ "Default": "t3.small"
+ },
+ "ChromaVersion": {
+ "Description": "Chroma version to install",
+ "Type": "String",
+ "Default": "0.3.21"
+ }
+ },
+ "Conditions": {
+ "HasKeyName": {
+ "Fn::Not": [
+ {
+ "Fn::Equals": [
+ {
+ "Ref": "KeyName"
+ },
+ ""
+ ]
+ }
+ ]
+ }
+ },
+ "Resources": {
+ "ChromaInstance": {
+ "Type": "AWS::EC2::Instance",
+ "Properties": {
+ "ImageId": {
+ "Fn::FindInMap": [
+ "Region2AMI",
+ {
+ "Ref": "AWS::Region"
+ },
+ "AMI"
+ ]
+ },
+ "InstanceType": {
+ "Ref": "InstanceType"
+ },
+ "UserData": {
+ "Fn::Base64": {
+ "Fn::Join": [
+ "",
+ [
+ "Content-Type: multipart/mixed; boundary=\"//\"\n",
+ "MIME-Version: 1.0\n",
+ "\n",
+ "--//\n",
+ "Content-Type: text/cloud-config; charset=\"us-ascii\"\n",
+ "MIME-Version: 1.0\n",
+ "Content-Transfer-Encoding: 7bit\n",
+ "Content-Disposition: attachment; filename=\"cloud-config.txt\"\n",
+ "\n",
+ "\n",
+ "#cloud-config\n",
+ "cloud_final_modules:\n",
+ "- [scripts-user, always]\n",
+ "\n",
+ "\n",
+ "--//\n",
+ "Content-Type: text/x-shellscript; charset=\"us-ascii\"\n",
+ "MIME-Version: 1.0\n",
+ "Content-Transfer-Encoding: 7bit\n",
+ "Content-Disposition: attachment; filename=\"userdata.txt\"\n",
+ "\n",
+ "\n",
+ "#!/bin/bash\n",
+ "amazon-linux-extras install docker\n",
+ "usermod -a -G docker ec2-user\n",
+ "curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose\n",
+ "chmod +x /usr/local/bin/docker-compose\n",
+ "ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose\n",
+ "systemctl enable docker\n",
+ "systemctl start docker\n",
+ "\n",
+ "cat << EOF > /home/ec2-user/docker-compose.yml\n",
+ "version: '3.9'\n",
+ "\n",
+ "networks:\n",
+ " net:\n",
+ " driver: bridge\n",
+ "\n",
+ "services:\n",
+ " server:\n",
+ {
+ "Fn::Sub": " image: ghcr.io/chroma-core/chroma:${ChromaVersion}\n"
+ },
+ " volumes:\n",
+ " - index_data:/index_data\n",
+ " environment:\n",
+ " - CHROMA_DB_IMPL=clickhouse\n",
+ " - CLICKHOUSE_HOST=clickhouse\n",
+ " - CLICKHOUSE_PORT=8123\n",
+ " ports:\n",
+ " - 8000:8000\n",
+ " depends_on:\n",
+ " - clickhouse\n",
+ " networks:\n",
+ " - net\n",
+ "\n",
+ " clickhouse:\n",
+ " image: clickhouse/clickhouse-server:22.9-alpine\n",
+ " environment:\n",
+ " - ALLOW_EMPTY_PASSWORD=yes\n",
+ " - CLICKHOUSE_TCP_PORT=9000\n",
+ " - CLICKHOUSE_HTTP_PORT=8123\n",
+ " ports:\n",
+ " - '8123:8123'\n",
+ " - '9000:9000'\n",
+ " volumes:\n",
+ " - clickhouse_data:/bitnami/clickhouse\n",
+ " - backups:/backups\n",
+ " - ./config/backup_disk.xml:/etc/clickhouse-server/config.d/backup_disk.xml\n",
+ " - ./config/chroma_users.xml:/etc/clickhouse-server/users.d/chroma.xml\n",
+ " networks:\n",
+ " - net\n",
+ "\n",
+ "volumes:\n",
+ " clickhouse_data:\n",
+ " driver: local\n",
+ " index_data:\n",
+ " driver: local\n",
+ " backups:\n",
+ " driver: local\n",
+ "\n",
+ "EOF\n",
+ "\n",
+ "mkdir /home/ec2-user/config\n",
+ "\n",
+ "cat << EOF > /home/ec2-user/config/backup_disk.xml\n",
+ "