Run Sparq locally
Start a complete local Sparq stack for development and evaluation.
Early access
The local stack is available to early-access teams with access to the Sparq source. It is for
development only: it binds to 127.0.0.1 and uses no TLS.
Requirements
Docker with Compose v2, uv, curl, openssl and Python 3.
Start the stack
scripts/sparq.sh upThe script:
- creates a local
.envwith random passwords and a signing key for delegated tool tokens; - starts PostgreSQL 16 with pgvector, and Redis 7;
- creates the database roles and runs the migrations;
- creates the first operator key once and writes it to
.secrets/operator-api-key(file mode 600, never printed); - starts the API behind a local edge on
http://127.0.0.1:8000and checks/health/readyand/v1/whoami.
Other commands: scripts/sparq.sh status, logs, restart and down. Stopping never deletes data.
Call the local API
curl -H "Authorization: Bearer $(cat .secrets/operator-api-key)" http://127.0.0.1:8000/v1/whoamiAn operator key answers with principal_type service. Then follow the quickstart
with SPARQ_API_URL=http://127.0.0.1:8000.
Load a model registry
The model registry lists the deployments the Frontier Gateway may use. It names each provider key by
reference (env:NAME), never by value.
uv run python -m sparq_control.admin registry load config/registry/dev.jsonThe file is validated as a whole and applied in one audited transaction; loading the same file again changes nothing. Read it back with the models operations: model classes, deployments, routing rules and prices.