Metadata-Version: 2.5
Name: somm
Version: 0.15.0
Summary: somm — self-hosted LLM telemetry, routing, and intelligence loop (library)
Project-URL: Homepage, https://github.com/lavallee/somm
Project-URL: Repository, https://github.com/lavallee/somm
Project-URL: Issues, https://github.com/lavallee/somm/issues
Project-URL: Changelog, https://github.com/lavallee/somm/blob/main/CHANGELOG.md
Author: Marc Lavallee
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27
Requires-Dist: somm-core==0.15.0
Provides-Extra: jsonschema
Requires-Dist: jsonschema>=4; extra == 'jsonschema'
Provides-Extra: litellm
Requires-Dist: litellm>=1.50; extra == 'litellm'
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
Provides-Extra: postgres
Requires-Dist: psycopg[binary]>=3.2; extra == 'postgres'
Provides-Extra: pydantic
Requires-Dist: pydantic>=2; extra == 'pydantic'
Provides-Extra: tokenizers
Requires-Dist: tiktoken>=0.7; extra == 'tokenizers'
Description-Content-Type: text/markdown

# 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.

```python
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.

```python
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](https://github.com/lavallee/somm).
