Skip to content

User Guide

This guide explains how to operate and integrate a MIG v0.1 runtime in development and production-like environments.

If you want the shortest path to first success, start with Quickstart.

The runtime exposes MIG core operation planes:

  • Discovery: HELLO, DISCOVER
  • Invocation: INVOKE, CANCEL
  • Events: PUBLISH, SUBSCRIBE
  • Control: HEARTBEAT

Transport options:

  • HTTP (required)
  • gRPC (optional)
  • NATS (optional)
Terminal window
MIGD_AUTH_MODE=none migd
Terminal window
MIGD_AUTH_MODE=jwt \
MIGD_JWT_HS256_SECRET=<set-a-strong-secret> \
migd

JWT mode expectations:

  • Authorization: Bearer <token>
  • tenant_id (or tenant) claim
  • Optional capability scopes via scope / scopes
VariableDefaultDescription
MIGD_ADDR:8080HTTP listen address
MIGD_GRPC_ADDRemptygRPC listen address; empty disables gRPC
MIGD_AUTH_MODEnonenone or jwt
MIGD_JWT_HS256_SECRETemptyRequired when MIGD_AUTH_MODE=jwt
MIGD_ENABLE_METRICStrueEnables metrics endpoint
MIGD_NATS_URLemptyEnables NATS connectivity
MIGD_ENABLE_NATS_BINDINGtrueEnables NATS request/reply binding
MIGD_AUDIT_LOG_PATHemptyEnables JSONL audit sink
  • POST /mig/v0.1/hello
  • POST /mig/v0.1/discover
  • POST /mig/v0.1/invoke/{capability}
  • POST /mig/v0.1/publish/{topic}
  • GET /mig/v0.1/subscribe/{topic} (SSE)
  • POST /mig/v0.1/cancel/{message_id}
  • POST /mig/v0.1/heartbeat
  • GET /mig/v0.1/stream (WebSocket)
Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/hello \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{
"header": {"tenant_id": "acme"},
"supported_versions": ["0.1"],
"requested_bindings": ["http"]
}'
Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/discover \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{"header": {"tenant_id": "acme"}}'
Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/invoke/observatory.models.infer \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{
"header": {
"tenant_id": "acme",
"idempotency_key": "idem-1",
"deadline_ms": 30000
},
"payload": {"input": "hello"}
}'

Behavior notes:

  • idempotency_key supports safe retries.
  • deadline_ms limits execution time.
  • In JWT mode, invocation can be scope-filtered.
Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/cancel/msg-123 \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{
"header": {"tenant_id": "acme"},
"target_message_id": "msg-123",
"reason": "operator cancel"
}'

Subscriber:

Terminal window
curl -N http://localhost:8080/mig/v0.1/subscribe/observatory.inference.completed \
-H 'X-Tenant-ID: acme'

Publisher:

Terminal window
curl -sS -X POST http://localhost:8080/mig/v0.1/publish/observatory.inference.completed \
-H 'Content-Type: application/json' \
-H 'X-Tenant-ID: acme' \
-d '{
"header": {"tenant_id": "acme"},
"payload": {"status": "ok"}
}'
Terminal window
MIGD_GRPC_ADDR=:9090 migd

See gRPC Binding.

Terminal window
MIGD_NATS_URL=nats://localhost:4222 \
MIGD_ENABLE_NATS_BINDING=true \
migd

See NATS Binding.

  • GET /metrics for Prometheus scraping
  • GET /admin/v0.1/health/conformance for runtime conformance health
  • GET /ui for browser-based quick checks