Skip to main content

anvil-serving - local model serving and a thin capability gateway

anvil-serving

Benchmark and serve local models through one explicit capability gateway.

License: MIT Source Version Docs

anvil-serving runs and benchmarks local model serves, then exposes their named capabilities through one authenticated endpoint. It is deliberately a thin gateway: a caller chooses a configured model alias, and that alias maps to one local tier. There is no request classifier, quality-profile router, semantic fallback, cloud escalation, or hidden substitute model.

The reference topology serves primary LLM work on the RTX PRO 6000. The RTX 5090 offers either an exclusive 30B Omni stack for auxiliary text, general vision, and OCR, or a smaller Omni stack co-resident with dedicated STT/TTS. Embeddings/reranking and on-demand ComfyUI remain optional separate stacks. The gateway keeps authentication, dialect translation, streaming, readiness, admission, and decision evidence consistent across those capabilities.

Direct capability contract

[router.model_routes]
llm.primary = "primary-local"
llm.voice = "omni-local"
vision.ocr = "omni-local"
vision.general = "omni-local"

Send one of those aliases as the chat model. Matching is case-insensitive after trimming; compatibility prefixes are not accepted. /v1/models advertises the configured aliases. Unknown or missing chat aliases return 404. An unavailable selected tier returns an exhaustion error, not an alternate model.

Purpose models and audio are equally explicit: embeddings and reranking use their configured model names on dedicated endpoints, while STT/TTS use operator-configured audio routes. ComfyUI is lifecycle-managed rather than a chat capability.

Quick start

Python 3.11+ is the only runtime prerequisite. Docker and a GPU are required only for real local model serves.

pip install -e .
anvil-serving init
anvil-serving serves groups
anvil-serving serves up SERVE_NAME --dry-run
anvil-serving serves up SERVE_NAME --confirm
anvil-serving router run

init writes the packaged operational manifests to ~/.anvil-serving. It detects NVIDIA GPU UUIDs with nvidia-smi, assigns the highest-VRAM card to Primary and the lowest-VRAM card to Auxiliary, and resolves the host's Tailscale IPv4 address. Equal-VRAM cards are assigned deterministically by runtime index. Use explicit host-value flags to override discovery, --no-detect-host to keep placeholders, --out-dir to choose another location, or --single-model for a focused one-model scaffold. serves up is the canonical bring-up path for models and other manifest-owned resources. Rerunning init leaves content-identical files untouched; only changed files receive numbered backups before replacement. Preview the resolved operation before confirming it.

With the selected serves running, call the gateway:

curl -s http://127.0.0.1:8000/v1/models
curl -s http://127.0.0.1:8000/v1/chat/completions \
  -H 'content-type: application/json' \
  -d '{"model":"llm.primary","messages":[{"role":"user","content":"hello"}]}'

Use anvil-serving eval preflight before mapping a real model to an alias, and record capacity and quality evidence with anvil-serving eval benchmark. A mapping is an exposure decision, not a model promotion claim.

What it provides

Surface Purpose
anvil-serving router run Authenticated Anthropic/OpenAI-compatible capability gateway.
anvil-serving serves Compose-backed model lifecycle, GPU reservation, and switching tools.
anvil-serving eval preflight Functional qualification of a concrete endpoint.
anvil-serving eval benchmark Capacity and quality evidence collection.
anvil-serving models Model cache, source, and serve-recipe management.
anvil-serving voice Operator-owned STT/TTS, bridge, Realtime, and voice benchmark lifecycle.
anvil-serving mcp serve / controller Structured same-host or private control-plane access.

Documentation

Security and operating boundaries

  • Use 127.0.0.1, never localhost, for same-host URLs.
  • Keep router authentication enabled before exposing it beyond loopback.
  • Store credentials only through environment-variable references.
  • Treat readiness and preflight as different checks: readiness says a serve can receive traffic; preflight and benchmark evidence establish whether it should.
  • Fakoli Mini is model-free in the reference topology. Its local audio proxy ports forward to Dark; they do not make Mini a serving host.

See SECURITY.md for the threat model and reporting policy.

Release files for anvil-serving 0.15.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 anvil-serving 0.15.0
File Size Uploaded
anvil_serving-0.15.0.tar.gz 866.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anvil-serving 0.15.0
File Interpreter ABI Platform
anvil_serving-0.15.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / anvil_serving-0.15.0.tar.gz

Download URL anvil_serving-0.15.0.tar.gz
Size 866.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4f7815de0d7383843d49297fce93ba365fc1905fec60b63b2f6bf440792978c1
BLAKE2b-256 checksum
How to use checksums
4eea43ca72aa017b7304a2f7c353c252c02ec912ab856fd7e24456b8ca834f9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release files / anvil_serving-0.15.0-py3-none-any.whl

Download URL anvil_serving-0.15.0-py3-none-any.whl
Size 792.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a68dac3549a383a391bd4522a24d57d29c8d3bcf5c4ee4062fe547dbc5409c82
BLAKE2b-256 checksum
How to use checksums
7e0fce49b6ebd882c1bb5061c9661950f6249456e0bab9804e53143ef09cfcf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log
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