swarph-mesh¶
Model-agnostic Python substrate for the swarph-mesh ecosystem — the graph protocol third-party CLIs plug into.
swarph-mesh is the bottom layer of a four-package ecosystem:
Package |
Role |
|---|---|
substrate primitives shared across all swarph packages (caller convention, subprocess env scrubbing, JSON mode, peer registry) |
|
|
typed Protocol + adapters + SwarphCall + MeshClient + discovery |
|
|
Simon Willison |
What this documentation covers¶
This site auto-renders the public contract surface of swarph-mesh. The contract is enumerated in DEPRECATIONS.md — Tier 1 / Tier 2 / Tier 3.
Tier 1 — third-party-node-implementer-facing primitives. Highest stability.
LLMAdapterProtocol,ChatMessage,LLMResponse,MeshClient,MeshMessage, discovery primitives. Changes here trigger the deprecation cycle inDEPRECATIONS.md.Tier 2 — consumer-facing-but-internal-friendly.
SwarphCall,AttributionWriter,HookSet, normalization helpers.Tier 3 — best-effort-documented. Adapter-local
PRICINGdicts, internal pricing tables.Not part of the contract — module-level private
_*symbols, test fixtures, mesh-gateway database schema (separate repo).
If a symbol is not visible in these auto-generated pages, it is not part of the contract.
Stability commitments¶
Three documents anchor the contract surface:
SECURITY.md— 9 in-scope vulnerability classes; “Protocol contract violation” is reportable as a security event.DEPRECATIONS.md— what counts as breaking, deprecation cycle requirements, mypy-strict ratchet schedule.CHANGELOG.md— full per-release history.
API reference
- Types —
swarph_mesh.types - Adapters —
swarph_mesh.adapters - SwarphCall —
swarph_mesh.swarph_call - MeshClient —
swarph_mesh.mesh_client - Discovery —
swarph_mesh.discoveryModelInfoinvalidate_catalog()list_models()is_model_supported()get_model_info()normalize_xai_id()normalize_deepseek_id()normalize_model_id()is_retired()retirement_date()ProviderPricinginvalidate_pricing()fetch_gemini_pricing()pricing_for_anthropic_model()list_anthropic_pricing()DeepSeekBalancefetch_deepseek_balance()XAICostBucketfetch_xai_cost_buckets()reconcile_xai_cost()CostBucketfetch_openai_cost_buckets()reconcile_openai_cost()pricing_for_gemini_model()
- Attribution —
swarph_mesh.attribution - Hooks —
swarph_mesh.hooks - Exceptions —
swarph_mesh.exceptions