REST Server for CyborgDB: The Confidential Vector Database
5.1K
CyborgDB Service is the FastAPI-based REST API server for CyborgDB — the vector database that stays encrypted even while it's searching. It serves encrypted vector ingestion, search, and retrieval over HTTP: vectors stay encrypted through search, and only the result of a query is decrypted. This image is CPU-optimized and multi-arch — run it in your own VPC or on-prem.
Note: This is the CPU variant. For NVIDIA GPU acceleration, use
cyborginc/cyborgdb-service-cuda.
Fastest path to a first query: the Docker quickstart on docs.cyborg.co runs as pasted and is kept current with every release.
Evaluating? Use docker run below. Deploying? Jump to Docker Compose.
No API key is required: without one the service runs the free tier (per-index cap: 1,000,000 items). Add -e CYBORGDB_API_KEY=cyborg_... for unlimited usage — create a key at cyborgdb.co/new.
Data lives in /app/cyborgdb_data inside the container; the -v mount below keeps it across restarts.
docker run --rm -p 127.0.0.1:8000:8000 \
-v cyborgdb_data:/app/cyborgdb_data \
cyborginc/cyborgdb-service:latest
Check that it is up:
curl http://localhost:8000/v1/health
Interactive API docs: http://localhost:8000/v1/docs.
The command above exposes the service only on the Docker host's localhost interface.
For remote deployments, set CYBORGDB_SERVICE_ROOT_KEY and configure clients
to send that key or a cdbk_ user token.
CYBORGDB_API_KEY controls licensing; it does not authenticate REST requests.
Do not expose an unauthenticated service to remote clients.
With the service running, install the Python client and complete a connect → index → upsert → query loop:
pip install cyborgdb
import cyborgdb
import secrets
# Connect to the running service.
client = cyborgdb.Client(base_url="http://localhost:8000")
# Generate an encryption key for the index.
# WARNING: store this key securely — data encrypted with a lost key is unrecoverable.
index_key = secrets.token_bytes(32)
# Create an encrypted index.
index = client.create_index(index_name="my_index", index_key=index_key)
# Upsert some items.
items = [
{"id": "item_1", "vector": [0.1, 0.2, 0.3, 0.4], "contents": "Hello!"},
{"id": "item_2", "vector": [0.5, 0.6, 0.7, 0.8], "contents": "Bonjour!"},
{"id": "item_3", "vector": [0.9, 0.10, 0.11, 0.12], "contents": "Hola!"},
]
index.upsert(items)
# Query — include distance + metadata, then chain get() for contents.
results = index.query(
query_vectors=[0.1, 0.2, 0.3, 0.4],
top_k=2,
include=["distance", "metadata"],
)
top_items = index.get([r["id"] for r in results])
by_id = {item["id"]: item for item in top_items}
for r in results:
contents = by_id[r["id"]]["contents"]
print(f"ID: {r['id']} Distance: {r['distance']:.4f} Contents: {contents}")
Lost key = lost data. CyborgDB has no key-recovery path. For anything past evaluation, keep
index_keyin AWS Secrets Manager, Vault, or your KMS. See Managing Keys.
JavaScript/TypeScript and Go clients: see the SDK docs.
Disk is the default (see Quick Start above).
On AWS infrastructure, do not pass credentials: the AWS default credential provider chain picks up the task/instance role automatically.
docker run -it -p 127.0.0.1:8000:8000 \
-e CYBORGDB_API_KEY=cyborg_your_api_key_here \
-e CYBORGDB_DB_TYPE=s3 \
-e CYBORGDB_S3_BUCKET=my-bucket \
-e CYBORGDB_S3_REGION=us-east-1 \
cyborginc/cyborgdb-service:latest
AWS_* env vars or mounted profile)Off AWS, hand the default chain credentials the usual way — AWS_*
environment variables or a mounted ~/.aws profile:
docker run -it -p 127.0.0.1:8000:8000 \
-e CYBORGDB_API_KEY=cyborg_your_api_key_here \
-e CYBORGDB_DB_TYPE=s3 \
-e CYBORGDB_S3_BUCKET=my-bucket \
-e CYBORGDB_S3_REGION=us-east-1 \
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN \
cyborginc/cyborgdb-service:latest
A custom endpoint means "this is not AWS": explicit CYBORGDB_S3_*
credentials are required, and the AWS chain is never used against the
endpoint (startup fails fast if the keys are missing). The CYBORGDB_S3_*
namespace is deliberately separate from AWS_*, so the same container can
talk to MinIO for storage and AWS for KMS/BYOK without the credentials
colliding:
docker run -it -p 127.0.0.1:8000:8000 \
-e CYBORGDB_API_KEY=cyborg_your_api_key_here \
-e CYBORGDB_DB_TYPE=s3 \
-e CYBORGDB_S3_BUCKET=cyborgdb \
-e CYBORGDB_S3_ENDPOINT=https://minio.internal:9000 \
-e CYBORGDB_S3_ACCESS_KEY=minio-access-key \
-e CYBORGDB_S3_SECRET_KEY=minio-secret-key \
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_REGION \
cyborginc/cyborgdb-service:latest
This image supports multiple architectures and will automatically pull the correct one for your system:
| Architecture | Status | Use Case |
|---|---|---|
linux/amd64 | ✅ Supported | Intel/AMD servers, most cloud instances |
linux/arm64 | ✅ Supported | Apple Silicon Macs, ARM servers, Raspberry Pi 4+ |
services:
cyborgdb:
image: cyborginc/cyborgdb-service:latest
ports:
- "127.0.0.1:8000:8000"
# CYBORGDB_API_KEY is optional (free tier when unset); add it for
# unlimited usage.
# environment:
# - CYBORGDB_API_KEY=cyborg_your_api_key_here
volumes:
- cyborgdb_data:/app/cyborgdb_data
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/v1/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
cyborgdb_data:
services:
cyborgdb:
image: cyborginc/cyborgdb-service:latest
ports:
- "127.0.0.1:8000:8000"
environment:
- CYBORGDB_API_KEY=cyborg_your_api_key_here
- CYBORGDB_DB_TYPE=s3
- CYBORGDB_S3_BUCKET=my-bucket
- CYBORGDB_S3_REGION=us-east-1
# Off AWS: forward chain credentials (omit on ECS/EC2/EKS).
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/v1/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
Run either file with docker compose up -d.
A YAML config file (service settings + per-index KMS registry) can be
mounted to /app/cyborgdb.yaml — see the YAML reference.
| Variable | Description | Required | Example |
|---|---|---|---|
CYBORGDB_API_KEY | CyborgDB license key; unset runs the free tier (1M items/index) | ❌ | cyborg_abc123... |
CYBORGDB_SERVICE_ROOT_KEY | Service auth key; when set, requests must send it (or a cdbk_ user token). Unset = auth disabled | ❌ | cyborg_root... |
CYBORGDB_DB_TYPE | Storage backend | ❌ (default disk) | disk or s3 |
CYBORGDB_DISK_PATH | Disk data directory | ❌ (default /app/cyborgdb_data in Docker) | /app/cyborgdb_data |
CYBORGDB_S3_BUCKET | S3 bucket name | ✅ when s3 | my-bucket |
CYBORGDB_S3_REGION | S3 region | ❌ | us-east-1 |
CYBORGDB_S3_PREFIX | Key prefix within the bucket | ❌ | cyborgdb/ |
CYBORGDB_S3_ENDPOINT | S3-compatible endpoint (MinIO etc.) | ❌ | https://minio.internal:9000 |
CYBORGDB_S3_ACCESS_KEY | Explicit S3 access key | ✅ when endpoint set | minio-access-key |
CYBORGDB_S3_SECRET_KEY | Explicit S3 secret key | ✅ when endpoint set | minio-secret-key |
CYBORGDB_S3_SESSION_TOKEN | Explicit S3 session token | ❌ | — |
CYBORGDB_CONFIG_FILE | Path to YAML config file | ❌ | /etc/cyborgdb/cyborgdb.yaml |
CYBORGDB_EMBED_CACHE | Embedding model download cache | ❌ (default /app/cyborgdb_data/embed-cache in Docker) | /app/cyborgdb_data/embed-cache |
CYBORGDB_EMBED_OFFLINE | Fail on an embedding-model cache miss instead of downloading (air-gapped) | ❌ | 1 |
CYBORGDB_DISK_PATH (the image defaults it to /app/cyborgdb_data — mount a volume there)CYBORGDB_S3_BUCKETCYBORGDB_S3_* keys required with a custom endpoint (see Deployment Scenarios above)python:3.14-slimlinux/amd64, linux/arm64Content type
Image
Digest
sha256:856ffe60f…
Size
118.5 MB
Last updated
about 1 month ago
docker pull cyborginc/cyborgdb-service