Metadata-Version: 2.4
Name: lm15
Version: 0.1.0
Summary: Universal LM core with pluggable provider adapters
Project-URL: Homepage, https://github.com/maxime/lm15
Project-URL: Documentation, https://github.com/maxime/lm15
Project-URL: Issues, https://github.com/maxime/lm15/issues
Author: lm15 contributors
License-File: LICENSE
Keywords: adapters,ai,anthropic,gemini,llm,openai,streaming
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == 'dev'
Requires-Dist: pycurl>=7.45.0; extra == 'dev'
Requires-Dist: twine>=5.1.1; extra == 'dev'
Provides-Extra: speed
Requires-Dist: pycurl>=7.45.0; extra == 'speed'
Description-Content-Type: text/markdown

# lm15 (Universal LM) — thin core, full plugin contract

A universal LM core optimized for low import/runtime overhead with provider plugins.

## Core architecture

- **Universal contract** (`types.py`): normalized request/response/stream/live types.
- **Provider plugin contract** (`providers/base.py`): complete/stream/live/embeddings/files/batch/images/audio methods.
- **Transport boundary** (`transports/*`): urllib and pycurl implementations.
- **Capability resolver** (`capabilities.py`): static + optional hydration from models.dev.
- **Model catalog bridge** (`model_catalog.py`): loads `https://models.dev/api.json`.
- **Middleware pipeline** (`middleware.py`): retries/history/cache wrappers.
- **Completeness harness** (`completeness/*`): fixture + live probes, score output.

## Quick start

```python
from lm15 import Message, LMRequest, Part, build_default

lm = build_default(use_pycurl=True)
req = LMRequest(model="claude-sonnet-4-5", messages=(Message(role="user", parts=(Part.text_part("Say hi."),)),))
resp = lm.complete(req)
print(resp.message.parts[0].text)
```

## External plugin adapters (no core PR)

LM15 auto-discovers installed entry-points in group `lm15.providers`.

```toml
# in external package pyproject.toml
[project.entry-points."lm15.providers"]
myprovider = "ulm_x_myprovider:build_adapter"
```

```python
from lm15 import build_default

lm = build_default(discover_plugins=True)
```

## Optional models.dev hydration

```python
lm = build_default(hydrate_models_dev_catalog=True)
```

## Completeness

```bash
python3 completeness/runner.py --mode fixture --fail-under 1.0
python3 completeness/runner.py --mode live --fail-under 0.0
```

Outputs:
- `completeness/report.json`
- `completeness/report.md`

## Packaging and publishing (uv + twine)

```bash
# build sdist + wheel
uv run python -m build

# upload to TestPyPI
# twine upload --repository testpypi dist/*

# upload to PyPI
# twine upload dist/*
```

## Environment variables

- `OPENAI_API_KEY`
- `ANTHROPIC_API_KEY`
- `GEMINI_API_KEY` or `GOOGLE_API_KEY`

## Docs

### Core

- `docs/GETTING_STARTED.md`
- `docs/CONCEPTS.md`
- `docs/ARCHITECTURE.md`
- `docs/CONTRACT.md`
- `docs/ERRORS.md`
- `docs/STREAMING.md`
- `docs/COMPLETENESS.md`
- `docs/PRODUCTION_CHECKLIST.md`

### Provider development

- `docs/ADAPTER_GUIDE.md`
- `docs/ADD_PROVIDER_GUIDE.md`
- `docs/COOKBOOK_TEMPLATE.md`

### Cookbooks (learning order)

- `docs/COOKBOOKS/01-basic-text.md`
- `docs/COOKBOOKS/02-streaming.md`
- `docs/COOKBOOKS/03-tools.md`
- `docs/COOKBOOKS/04-multimodal.md`
- `docs/COOKBOOKS/05-files-batches.md`
- `docs/COOKBOOKS/06-reliability.md`
- `docs/COOKBOOKS/07-external-plugins.md`
- `docs/COOKBOOKS/08-models-dev-hydration.md`
