somm
Self-hosted LLM telemetry, routing, and intelligence loop.
The main library: SommLLM — one call wraps telemetry, provider routing
across ten providers, tool calling, streaming, embeddings, multimodal
dispatch, cost tracking, budget gates, online evaluation, durable eval
gates, prompt optimization proposals, experiment campaigns, and
cross-project model memory (the sommelier). It also exposes a neutral
one-attempt harness API for Claude Code, Codex, and OpenCode so task runners
do not reimplement CLI and event-stream adapters. Zero-config, privacy-first,
no phone-home.
import somm
llm = somm.llm(project="my_app")
result = llm.generate(prompt="Reply with exactly: pong", workload="ping")
print(result.text, result.provider, result.cost_usd)
Async code can call await llm.agenerate(...), await llm.aembed(...),
await llm.agenerate_structured(...), or iterate llm.astream(...). These
methods use the same synchronous routing, embedding, governance, and telemetry
paths without blocking the caller's event loop.
from somm import harnesses
from somm.harnesses import HarnessRequest
result = harnesses.run("codex", HarnessRequest(
prompt="Fix the failing tests",
cwd="~/src/my-project",
capture_dir="./runs/task-1",
))
print(result.outcome, result.final_text)
Full documentation, design docs, and examples live in the somm repository.
New-project Ollama default and text-only Claude CLI calls
The Ollama default remains qwen3:8b for compatibility; Somm does not
automatically substitute an installed model. If it is absent, install it with
ollama pull qwen3:8b, or run ollama list and select an installed generation
model using SOMM_OLLAMA_MODEL, [tool.somm].ollama_model in pyproject.toml,
or the per-call --model / model= option. A 404 now includes this guidance.
Claude CLI calls are lean by default: no built-in tools, MCP servers, or
setting sources, no persisted session (--no-session-persistence, skipped on a
CLI too old to know it), and a neutral working directory. A one-word prompt
costs about 3.6k input tokens instead of about 34k. With no model given the
provider runs claude-haiku-5-5 (override with SOMM_CLAUDE_CLI_MODEL or
claude_cli_model), not the CLI's own default; the row records the model that
actually served. Configured claude_cli_extra_args / SOMM_CLAUDE_CLI_ARGS
replace the lean flag set.
claude_cli_text_only / --claude-cli-text-only is the same lean set, asserted
explicitly for untrusted text:
somm generate --provider claude-cli --claude-cli-text-only --json "Summarize this text"
result = llm.generate(
untrusted_text,
provider="claude-cli",
claude_cli_text_only=True,
allow_fallback=False,
)
It requires a Claude CLI provider pin and disabled fallback, and is rejected
when claude_cli_extra_args / SOMM_CLAUDE_CLI_ARGS are configured. This mode
controls CLI tool access; it is not an operating-system sandbox.
somm generate exits 0 only for an OK result, and nonzero for failed outcomes,
including empty responses. JSON results retain ok, outcome, and
error_kind, and include error_detail for actionable diagnostics.
Metadata
Release files for somm 0.29.0
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 |
|---|---|---|---|---|
| somm-0.29.0.tar.gz | 485.8 kB | With provenance | Details for somm-0.29.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| somm-0.29.0-py3-none-any.whl | Python 3 | none | any | Details for somm-0.29.0-py3-none-any.whl |
Total release size: 833.5 kB
Release files / somm-0.29.0.tar.gz
| Download URL | somm-0.29.0.tar.gz |
|---|---|
| Size | 485.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a48937e5fd0fa01609815d0556c838743064396b3f4109b56febe00b988f6132
|
|
BLAKE2b-256 checksum How to use checksums |
7abc31590cb0563796bf494e7d4bec32f3cfb7816f43d705ca3def297e46c68c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Nov 17, 2026.
Transparency logRelease files / somm-0.29.0-py3-none-any.whl
| Download URL | somm-0.29.0-py3-none-any.whl |
|---|---|
| Size | 347.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
260526578a94224190af5395ae09ccdac489a92a6302e7c3d362aa4e4cba7203
|
|
BLAKE2b-256 checksum How to use checksums |
4d8609814dff9e79bb1ce73bf2801a5ee17a816ae63dfd5862f6cf6522025e20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Nov 17, 2026.
Transparency logSecurity for somm 0.29.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for somm-0.29.0.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 17, 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.