Self-Hosted Runtime

Self-Host Synapse

Run Synapse on your own infrastructure. Evaluate it as deterministic execution for evaluators, reward functions, policy gates, and other bounded generated logic. The public endpoint exists only for demos and early evaluation. The supported governed workflow shell adds receipts, replay, redaction, and bounded escalation on top of the runtime.

Current Surface
GET /health
health and gateway status
POST /v1/execute
execute .syn or pre-compiled Wasm
POST /v1/execute/python
execute the supported Python subset
GET /v1/benchmark
live benchmark ring-buffer stats
Governed Workflow Shell

For design-partner workflows, run the self-hosted control-plane shell. It keeps the bounded runtime underneath, then adds local policy decisions, redaction, receipts, operator readouts, replayable artifacts, and proof packs.

POST /v1/control-plane/execute
run the governed workflow shell
GET /v1/control-plane/receipts/{request_id}
fetch persisted escalation receipt
GET /v1/control-plane/operator-readout/{request_id}
fetch operator-facing replay summary
GET /v1/control-plane/proof-pack/{request_id}
fetch proof pack + artifact references
Start the shell
python3 tools/control_plane_product.py serve
Run the commercial gate
python3 tools/run_control_plane_release_gate.py
Product Fit

Best Fits Right Now

evaluators and judges
reward functions
policy gates
bounded business logic
auditable transforms
deterministic agent-side helpers

Not A Fit For

arbitrary Linux workloads
general sandbox hosting
full CPython compatibility
multi-tenant managed billing
persistent state and file APIs

Synapse can accelerate the supported Python subset, but the clearest way to evaluate it is as deterministic execution for bounded logic, not as a general-purpose Python cloud.

Example Workloads
Verified policy gate
examples/verified_policy_gate.syn
@inv pure
@f 1 approve
if <= $0 1000
  1
  0

@f 0 main
call approve 900
Restricted-Python policy gate
examples/policy_gate.py
amount = 1250
limit = 1000
result = 0

if amount <= limit:
    result = 1
Restricted-Python reward function
examples/reward_function.py
target = 42
prediction = 39
delta = target - prediction

if delta < 0:
    delta = 0 - delta

result = 100 - delta

These examples are exercised through the real gateway with SYNAPSE_START_GATEWAY=1 python3 tests/test_self_hosted_examples.py.

Install
Docker
docker build -t synapse .
docker run -p 8000:8000 \
  -e SYNAPSE_API_KEY=local-gateway-key \
  synapse
Build From Source
brew install z3
cd synapse
./tools/build_gateway.sh

cd gateway
BINDGEN_EXTRA_CLANG_ARGS='-I/opt/homebrew/include' \
LIBRARY_PATH='/opt/homebrew/lib' \
cargo build --release

SYNAPSE_API_KEY=local-gateway-key \
SYNAPSE_GATEWAY_WASM=../gateway.wasm \
./target/release/synapse-gateway
Smoke Check
Health
curl http://127.0.0.1:8000/health
.syn Execution
curl -X POST http://127.0.0.1:8000/v1/execute \
  -H "Content-Type: application/json" \
  -d '{"code":"@f 0 main [ + 21 21 ]"}'
Restricted Python
curl -X POST http://127.0.0.1:8000/v1/execute/python \
  -H "Content-Type: application/json" \
  -d '{"code":"result = 21 + 21"}'

Invalid source is now explicit at the HTTP boundary: empty input returns 400 empty_code and malformed source returns 400 compile_failed.

Proof Commands
SYNAPSE_START_GATEWAY=1 python3 tests/release_test.py
SYNAPSE_START_GATEWAY=1 python3 tests/test_gateway_verification_http.py
SYNAPSE_START_GATEWAY=1 python3 tests/test_self_hosted_examples.py
python3 benchmarks/eval_only_benchmark.py

Use these commands to validate the runtime on your own machine. They are the current proof set for the self-hosted release path.

Verification Boundary

Stable end-to-end verification claims today are limited to three invariants:

@inv pure
@inv terminates
@inv no_oob

Broader assurance and sovereign-compute work exists in the R&D stack, but these are the properties defended at the current gateway boundary.

Environment
Variable
Default
Description
SYNAPSE_API_KEY
required
startup key for the gateway binary
SYNAPSE_GATEWAY_WASM
embedded
override the embedded gateway.wasm
SYNAPSE_PORT
8000
listen port
SYNAPSE_DB_PATH
data/state
local gateway state path
SYNAPSE_RATE_LIMIT
20
per-IP request limit

Start with the runtime. Verify the boundary.

If you are evaluating Synapse, run the quickstart, exercise the example workloads, and review the technical brief, benchmarks, and security model.