Provider-neutral runtime contracts and reusable primitives for AI agents
pip install jarvis-agent-core==0.17.2 Copy PIP instructions
jarvis-agent-core is a small, typed, dependency-free Python library for building portable AI-agent runtimes. It provides reusable contracts and deterministic runtime primitives without requiring a particular model vendor, application, database, deployment platform, user interface or operating-system sandbox.
The package is designed to be useful standalone. Any Python application can install it, implement the provider protocol, and reuse the shared runtime contracts.
Python 3.10+ is required. The current release is 0.17.2, which hardens shared inference timeout semantics. Publish this version only after the release workflow completes.
python -m pip install "jarvis-agent-core==0.17.2" For development:
git clone https://github.com/abdullahalrifat/jarvis-core.git cd jarvis-core python -m pip install -e . -r requirements-dev.txt python -m pytest Shared inference client (0.17.2) Both the Jarvis CLI and AI Stack use the Core inference client rather than implementing gateway configuration and protocol handling independently. Core provides a dependency-free InferenceConfig and InferenceClient for bearer authentication, model discovery, capability negotiation, chat completions, SSE streaming, embeddings, request IDs, and normalized transport errors. Applications retain ownership of their agent loops, tools, approvals, persistence, cancellation policy, and telemetry.
from jarvis_core import InferenceClient client = InferenceClient.from_env(user_agent="my-agent/1.0") models = client.list_models() response = client.complete( model="qwen3:1.7b", messages=[{"role": "user", "content": "Hello"}], ) Set INFERENCE_BASE_URL=http://inference-host:8080/v1 and INFERENCE_API_KEY for the gateway. JARVIS_BASE_URL and JARVIS_API_KEY remain supported as compatibility fallbacks. Core does not silently retry timed-out inference requests, avoiding accidental duplicate work on a bounded local model queue.
The 0.16.2 release adds the cost-aware local-first routing layer and keeps the previous empirical calibration and token-efficiency primitives intact:
Core owns the reusable routing policy; applications map the abstract tiers to concrete providers and models:
Deterministic tools │ ├── no LLM when possible │ ▼ LOCAL tier │ │ bounded failures / elevated complexity ▼ CHEAP tier │ │ bounded failures / high risk ▼ FRONTIER tier Core: routing signals, tier decisions, failure budgets and cost-aware model selection. AI Stack: provider execution, concrete model configuration, pricing data, telemetry and persistence. Jarvis: CLI behavior, workload definitions, user approvals and task-level evaluation. The intended default for a constrained personal server is local-first execution. Cloud tiers remain opt-in and should only be configured when a stronger model is needed.
The 0.16.0 release added provider-neutral empirical route calibration:
The 0.15.0 release added provider-neutral primitives for making agent execution more token-efficient and predictable:
These primitives are intentionally provider-neutral. Anthropic, Ollama, Hugging Face, LiteLLM and other provider integrations remain responsibilities of the consuming application. Provider-specific caching metadata, SDK behavior, credentials and transport logic do not belong in Core.
A typical application can use the primitives to keep the agent loop efficient: retrieve only relevant repository context, keep stable state structured and compact, use lightweight/local models for simple work, escalate to stronger models when task signals justify it, and rely on deterministic tools and verification rather than spending model tokens on work the runtime can perform directly.
See CHANGELOG.md for the complete release history.
Core contains provider-neutral building blocks for:
Core owns the meaning of agent execution: model contracts, tool vocabulary, capabilities, approval semantics, evidence, verification, execution state and portable isolation requirements. Applications own the actual execution adapters.
The Core boundary is deliberately implementation-neutral. A CLI can implement a sandbox with native OS primitives, while a server can implement the same requirements with containers or another isolated worker. Both consume the same policy semantics.
Core defines the model boundary and does not ship vendor SDKs. The shared InferenceClient owns the common Jarvis inference-gateway HTTP contract; applications may keep provider SDKs and vendor-specific transports, credential lifecycle, cancellation policy, telemetry and task-specific error handling at their own boundary.
This boundary keeps the package portable and safe to embed in different applications.
code/docs change -> version + CHANGELOG + README/docs -> CI metadata consistency check -> full CI -> merge to main -> validate exact merged SHA -> build wheel + sdist -> clean-environment install check -> checksums + provenance -> GitHub Release -> PyPI Trusted Publishing Consumers should depend on a published PyPI version rather than a mutable Git branch. During local development, an editable checkout may be used explicitly.
python scripts/check_release_consistency.py black --check src tests scripts ruff check src tests scripts --select E9,F63,F7,F82 pytest -q --cov=jarvis_core --cov-report=term-missing --cov-fail-under=85 python -m build python -m twine check dist/* See docs/contract-boundaries.md, docs/cost-aware-routing.md, docs/empirical-calibration.md, docs/releasing.md, CONTRIBUTING.md, AGENTS.md and SECURITY.md.
Jarvis Core is available under the MIT License.
ai agent llm orchestration tool-calling runtime
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.




