Inference Control Plane
Reusable, open-source inference observability and optimization control plane. It lets you connect, inspect, and optimize existing inference pipelines (Helicone, Langfuse, OpenTelemetry, vLLM) from a host application without moving that logic into the host. This package runs in production at Freuron, the AI platform where teams train, fine-tune, and serve their own language models; it is the open-source edition of the inference control plane Freuron uses to inspect and optimize its workloads, released so anyone can get the same visibility into their own pipelines without adopting the rest of the platform.
What it does
- Provider adapters for Helicone, Langfuse, and OpenTelemetry (OTLP) that pull and normalize inference events.
- Deterministic workload aggregation with cost/latency/quality projections against a caller-supplied target rate.
- Read-only vLLM monitoring via Prometheus
/metricsand/health(GET only). - Evidence-based recommendations and measured-vs-estimated comparisons between a current endpoint and a managed serving pool.
- Sample-data generation for evaluating the analysis without real provider data.
The package is stateless. The host application owns authentication, persistence, pricing configuration, and credential storage, and injects them as arguments. See the architecture documentation.
Install
pip install inference-control-plane
# local development against a checkout (run inside the repository root):
pip install -e .
Quick start (vLLM, read-only)
from inference_control_plane import EndpointConfig, VllmClient
from inference_control_plane.recommendations import recommend_from_snapshot
client = VllmClient(EndpointConfig(base_url="https://my-vllm.example.com"))
snapshot = await client.collect() # GET /metrics only; failures -> status="unreachable"
print(snapshot) # missing metrics are None, never 0
print(recommend_from_snapshot(snapshot)) # evidence-based, review-only
Private/self-hosted endpoints require allow_private_endpoints=True (explicit opt-in; the SSRF guard otherwise rejects non-global addresses, credentials in URLs, and non-HTTPS).
Capabilities probe
VllmClient.capabilities() probes /health, /v1/models, and /metrics with GET only and never raises: failures become notes in EndpointCapabilities.errors. It reports health_ok, the served models, and metrics_ok. Use it to check an endpoint before trusting a snapshot.
Derived rates
derive_rates(prev, curr) is a pure function over two MetricSnapshots. It returns DerivedRates (tokens_per_second, generation_tokens_per_second, prompt_tokens_per_second, requests_per_second). A missing counter, a non-positive window, or a rewound counter yields None for that rate — rates are never fabricated.
Cost estimate
estimate_effective_cost(snapshot, gpu_hourly_usd, tokens_per_second=None) returns None when no GPU hourly price is supplied. Otherwise it returns an EffectiveCost with hourly_cost_usd, effective_cost_per_utilized_hour_usd (hourly price spread over the utilized GPU fraction; None when utilization is unknown or zero), and cost_per_million_generation_tokens_usd. The result always carries kind="user_assumption": the price is asserted by the user, not measured, so every figure is an estimate, not a bill.
Comparison and kind labels
compare_snapshots(current, managed_snapshot=..., managed_kind=...) returns ComparisonRows (metric, current, managed, unit, kind, notes). Every row is labelled by provenance via kind:
measured— read from a live endpoint or a ready managed serving-pool replica.estimated— derived from measured inputs (for example a rate or a pool side whose status is notok).user_assumption— computed from a user-supplied input such asgpu_hourly_usd.
snapshot_from_pool_status(pool_payload) converts a generic serving-pool payload (including per-replica resources) into a MetricSnapshot so it can be compared with an external vLLM snapshot. Missing metrics stay None, never 0.
Workload analysis
from inference_control_plane.workload.analysis import analyze_events
summary, opportunities, assumptions = analyze_events(
events,
window_days=30,
managed_rate_usd_per_million=1.0,
ttft_ms=200.0,
output_tokens_per_second=50.0,
)
managed_rate_usd_per_million is the host-supplied target rate used for cost projections. The package ships no pricing of its own.
Known limitations
- Serving-pool payloads without measured per-replica
resourcesread asNonefor those fields. - No snapshot history or polling:
collect()is a single point-in-time read. Callers that need rates callderive_rateson two snapshots they collected themselves. - Host-application telemetry, persistence, and billing are not part of this package; see the architecture documentation linked above.
Development
pip install -e '.[dev]'
python -m pytest
python -m ruff check src tests
Releasing / rollback
See the releasing guide. Consumers pin an exact version; rollback is pinning the previous version and redeploying — no data migration is involved.
License
Apache License 2.0 — see the license.
Metadata
Release files for inference-control-plane 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inference_control_plane-0.1.2.tar.gz | 26.6 kB | With provenance | Details for inference_control_plane-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inference_control_plane-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for inference_control_plane-0.1.2-py3-none-any.whl |
Total release size: 57.1 kB
Release files / inference_control_plane-0.1.2.tar.gz
| Download URL | inference_control_plane-0.1.2.tar.gz |
|---|---|
| Size | 26.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef963142c708bf8ed2336eeeff14b5ddfa99ccc069e7cbade76accd9371b2a80
|
|
BLAKE2b-256 checksum How to use checksums |
90e1843f71164e943efea6567892457758484138cc541037c6d5d77f96645c97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logRelease files / inference_control_plane-0.1.2-py3-none-any.whl
| Download URL | inference_control_plane-0.1.2-py3-none-any.whl |
|---|---|
| Size | 30.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50ba508b0ad0035d0f5362c2642596f4ac199da4a208b40bcdc009241337a81f
|
|
BLAKE2b-256 checksum How to use checksums |
dc8689707d23ad3c43d69ed0667e59587001dd60816474139aa9b1d3ed0cafd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logSecurity for inference-control-plane 0.1.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for inference_control_plane-0.1.2.tar.gz
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 Nov 11, 2026.
Transparency logA 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.