llm-adapters
A minimal, auditable Python library for calling multiple LLM providers. Built as a lightweight alternative to LiteLLM after the March 2026 PyPI supply chain attack.
Why?
- Only 2 dependencies:
httpx+pydantic— no official SDKs, no bloat - Each provider is a single file — fully readable and auditable
- All deps pinned with hash verification in CI
- < 2000 lines of code — anyone can review the entire codebase in minutes
Install
pip install llm-dial
Quick Start
from llm_adapters import LLMClient
client = LLMClient()
# Unified interface — auto-routes to the correct provider
response = await client.chat(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.content)
# Streaming
async for chunk in client.chat_stream(
model="anthropic/claude-sonnet-4-20250514",
messages=[{"role": "user", "content": "Tell me a story"}],
):
print(chunk.content, end="")
Supported Providers
| Provider | Models | Auth |
|---|---|---|
| OpenAI | GPT-4o, GPT-4, o1, o3, etc. | OPENAI_API_KEY |
| Anthropic | Claude 4, Claude 3.5, etc. | ANTHROPIC_API_KEY |
| DeepSeek | deepseek-chat, deepseek-coder | DEEPSEEK_API_KEY |
| Ollama | Any local model (llama3, mistral, etc.) | None (local) |
Three Ways to Use
Your app
│
├── As a library: from llm_adapters import LLMClient
│
├── As a proxy: app → localhost:4000 → llm-adapters serve → LLM APIs
│ (drop-in LiteLLM sidecar replacement, zero code changes)
│
└── As a gateway base: app → llm-gateway → llm-adapters → LLM APIs
(add routing / auth / rate limiting / budget / observability)
Comparison with LiteLLM
| LiteLLM | llm-adapters | |
|---|---|---|
| Dependencies | 100+ transitive | 2 (httpx + pydantic) |
| Install size | ~50MB | <1MB |
| Supply chain risk | Compromised March 2026 | Minimal attack surface |
| Supported models | 100+ | Core 4 providers (enough for most) |
| Code size | Tens of thousands of lines | <2000 lines |
| Auditability | Complex | One file per adapter |
Security
This library was born from the LiteLLM supply chain incident. We take dependency security seriously:
- Minimal dependency tree (2 direct deps)
- All versions pinned with SHA-256 hashes in CI
- Automated
pip-auditon every PR - SBOM included in releases
- Published via GitHub Actions OIDC (Trusted Publishers) — no PyPI tokens
License
MIT
Metadata
Release files for llm-dial 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llm_dial-0.1.4.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_dial-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.7 kB
Release files / llm_dial-0.1.4.tar.gz
| Download URL | llm_dial-0.1.4.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
585d968e9706f10eefc789220a0de07df2aa1e806f45e0efbab9af667e652f67
|
|
BLAKE2b-256 checksum How to use checksums |
c53c326ce0440986d59901fd5e08ac9d2255dbdefbff7626558685348f5b07d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 26, 2026.
Transparency logRelease files / llm_dial-0.1.4-py3-none-any.whl
| Download URL | llm_dial-0.1.4-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd7fb36169278850f4030e419af71a37078dfac88bfa6eda63d9346252708b72
|
|
BLAKE2b-256 checksum How to use checksums |
a1e2c6b0438cd5a1f37fe53a92d3a1f095a3c9c732f42761caeedea2cb02b2de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 26, 2026.
Transparency log