Anthropic/OpenAI Compatible API

Keep your OpenAI or Anthropic code, streaming included, and point it at LayerScale. Session endpoints let you push data in as it arrives. There are client libraries for Python and TypeScript. Full API reference

Endpoints

  • POST /v1/chat/completions OpenAI-compatible
  • POST /v1/responses OpenAI Responses
  • POST /v1/messages Anthropic-compatible
  • POST /v1/sessions Create session
  • POST /v1/sessions/{id}/push Push data
  • POST /v1/sessions/{id}/generate Query the session
  • GET /v1/sessions/{id} Session status

You can also stream over WebSockets or Server-Sent Events (SSE). Both keep a single connection open.

terminal
# Create a session
curl -X POST http://127.0.0.1:8080/v1/sessions \
  -H "Content-Type: application/json" \
  -d '{"id": "ticker-feed"}'

# Push streaming data (non-blocking)
curl -X POST http://127.0.0.1:8080/v1/sessions/ticker-feed/push \
  -H "Content-Type: application/json" \
  -d '{"data": ["AAPL 231.10 +0.4%", "MSFT 415.22 -0.1%"]}'

# Query the standing session
curl -X POST http://127.0.0.1:8080/v1/sessions/ticker-feed/generate \
  -H "Content-Type: application/json" \
  -d '{"prompt": "What is the current trend?"}'

Run It Anywhere

Docker Recommended

docker run --gpus all -p 8080:8080 \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  layerscale/layerscale:latest \
  serve 0.0.0.0:8080 --model nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4

Query Your Server

curl http://127.0.0.1:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "What is a KV cache?"}], "max_tokens": 128}'

NVIDIA Dynamo

  • Kubernetes. Deploy through the Dynamo operator. Health probes and metrics are already set up.
  • Disaggregated serving. Prefill-only and decode-only workers scale independently, so a long prompt never stalls decoding for other requests.
  • Tensor parallelism. Each worker spans the GPUs in its pod with --tp, whether it serves whole requests or runs as the prefill or decode half of a pair.
  • KV-aware routing. Every worker reports its prefix cache to the router page by page. The router sends each request to the worker that already holds the most of its prompt.

Dynamo guide

Two Workers, Two GPUs Each

# Each worker needs a Pro license key
docker run --gpus '"device=0,1"' \
  -e LAYERSCALE_LICENSE_KEY=$LAYERSCALE_LICENSE_KEY layerscale/layerscale \
  dynamo --model Qwen/Qwen3.8-Flash-Next-FP8 --tp 2
docker run --gpus '"device=2,3"' \
  -e LAYERSCALE_LICENSE_KEY=$LAYERSCALE_LICENSE_KEY layerscale/layerscale \
  dynamo --model Qwen/Qwen3.8-Flash-Next-FP8 --tp 2

Across Machines

  • One process per node. --tp counts every GPU across the nodes and --nnodes the nodes that hold them. Each node runs the same command with its own --node-rank.
  • Through NCCL. The nodes can be the trays of a GB200 or GB300 NVL72 rack, which exchange over NVLink, or servers joined by InfiniBand, RoCE or Ethernet.
  • One endpoint. Node 0 serves the API. The other nodes hold their share of the model.
  • x86-64 and Grace. layerscale/layerscale:latest is multi-arch. Grace hosts (GH200, GB200, GB300) pull an arm64 build, and x86-64 hosts one that needs AVX2 (x86-64-v3).

Multi-node guide

Two Nodes, Four GPUs Each

# Every node needs a Pro license key
# Node 0 serves the API
docker run --gpus all --network host \
  -e LAYERSCALE_LICENSE_KEY=$LAYERSCALE_LICENSE_KEY \
  layerscale/layerscale:latest \
  serve 0.0.0.0:8080 --model nvidia/GLM-5.3-Flash-NVFP4 --tp 8 \
  --nnodes 2 --node-rank 0 --dist-init-addr node0:29500

# Node 1 runs the same command with --node-rank 1