Skip to main content

adaptive-serve

CI python 3.10+ MIT ruff 152 tests passing

adaptive-serve

Adaptive cloud-to-robot serving layer for robotics models of all types.

It takes any trained robotics model and serves it to a robot, scaling model quality up or down to fit the binding constraint: on-robot compute (TOPS/VRAM), power budget, latency tolerance, and live network bandwidth. Think adaptive bitrate streaming, but the renditions are model variants and the network is the robot's compute and link.

The whole core runs with no GPU, no network, and no external dependencies. An optional torch backend and a stdlib HTTP cloud adapter add real execution when you want it.

Why

A robot cannot round-trip to the cloud for every control step, and it must keep acting if the link drops. adaptive-serve picks the right variant and serving mode for the device in front of it, runs a slow cloud planner and a fast local reflex loop at the same time, and degrades safely when the cloud goes away.

Install

pip install -e ".[dev]"        # core plus test tooling
pip install -e ".[dev,torch]"  # also pull torch for the real backend

Try it

adaptive-serve demo                                  # full end to end demo
adaptive-serve serve --model planner --vram 2 --bandwidth 200 --difficulty hard
adaptive-serve serve --model planner --vram 80 --bandwidth 0  --difficulty hard

The same model adapts to the device, exactly like adaptive bitrate:

device               mode    variant                 ~latency ms  meets
tiny-edge-offline    local   planner-vlm:2B:int8            36.0  False
edge-weak-link       split   planner-vlm:7B:fp16           761.8   True
edge-fast-link       cloud   planner-vlm:7B:fp16            21.0   True
workstation          local   planner-vlm:7B:fp16             4.2   True

And it keeps acting through a cloud outage, degrading from NOMINAL to a latched emergency stop only when the last plan is long gone:

Multi-rate session with a cloud drop at 1000 ms:
  reflex steps: 1200
  plans published: 2
  safety mode timeline: {'nominal': 200, 'degraded': 531, 'hold': 400, 'kill': 69}
  final safety mode: kill

Calibration: decide on real numbers, not guesses

By default the router uses portable heuristics for footprint and latency. To ground its decisions in real hardware, measure actual models and route on those numbers instead:

adaptive-serve calibrate            # measure real models -> calibration.json
adaptive-serve pipeline             # calibrate -> route on measured -> run in torch

calibrate records the exact parameter count, the weight memory at each precision, and the measured forward latency per variant. A ModelRegistry built with that table feeds the router measured footprints (heuristics remain the fallback for any variant you have not measured), so a model that is actually small gets served where the heuristic would have offloaded it.

Honest scope: weight bytes and params are device-independent and drive the VRAM fit directly; latency is device-specific, so it stays informational. On a CPU box the harness measures real but small reference models and INT8 via torch dynamic quantization; the 7B/70B rungs and true INT4 need target hardware, which the same harness supports. Requires the torch extra: pip install -e ".[dev,torch]".

Supported model classes

The registry and router are generic across these, never hardcoded to one:

  • VLA / action policies (diffusion policies, ACT, flow-matching)
  • world / dynamics models (Dreamer-style, latent predictors, video predictors)
  • perception (detection, segmentation, depth, optical flow, 6DoF pose, keypoints)
  • VLMs / high-level reasoners (planning, language grounding)
  • state estimation / SLAM / odometry
  • classical or learned planners and controllers

Each declares its role in the stack, native rate (Hz), latency budget, and which scaling techniques it supports. Adding a new class touches no core.

Architecture

DeviceProfile  ---+
                  |
ModelSpec --> Registry: variant ladder (size x quant) per model, any class
                  |
                  v
             Router: pick variant + quant + serving mode (local / cloud / split)
                  |
   +--------------+--------------+
   |                             |
Scaling strategies          Orchestrator: cloud System-2 planner ~1 Hz
size/quant/input/exit/      + local System-1 reflex 50-1000 Hz
cascade/split                    |
   |                             v
   +--------------->  Safety governor: hold / kill on loss
                             |
                             v
                      Runtime + backends: run local (stub or torch) or
                      offload over HTTP, fall back to local on failure
                             |
                             v
                      Telemetry: record every step

Two invariants hold throughout, both covered by tests:

  • Generic across model classes. The router and scaling cores dispatch on a spec's declared role, tier, latency budget, and supported techniques, never on class identity.
  • The robot never blocks on the cloud. The reflex tier runs every control tick. On cloud loss the planner stops publishing, the reflex keeps acting on its last plan, the safety governor degrades to HOLD and latches KILL when the plan is too stale, and a late or failed cloud call is dropped for a safe local action rather than awaited.

Develop

ruff check .
pytest

See STATUS.md for the full component list and PLAN.md / ADAPTERS_PLAN.md for the build history. MIT licensed.

Metadata

Release files for adaptive-serve 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adaptive-serve 0.1.0
File Size Uploaded Provenance Actions
adaptive_serve-0.1.0.tar.gz 58.7 kB Without provenance Details for adaptive_serve-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adaptive-serve 0.1.0
File Interpreter ABI Platform Actions
adaptive_serve-0.1.0-py3-none-any.whl Python 3 none any Details for adaptive_serve-0.1.0-py3-none-any.whl

Total release size: 105.0 kB

Release files / adaptive_serve-0.1.0.tar.gz

Download URL adaptive_serve-0.1.0.tar.gz
Size 58.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6327fe50d93b4d32ba74ee79d7c3115557574e5a93fbae4c31965b6828796f26
BLAKE2b-256 checksum
How to use checksums
2f369d9534637d2d718e18a25ce9b9ec78c424459377d0c13ec049cd198181cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / adaptive_serve-0.1.0-py3-none-any.whl

Download URL adaptive_serve-0.1.0-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ab424a78e28397dd7ab9ed1f76751dd3e49e8a6aeaee5b19a85fb2eb3dde304
BLAKE2b-256 checksum
How to use checksums
8726177a5bfb62f66d87ede7d849c3da5798b68e31edf0bd699787acfce0c47f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for adaptive-serve 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page