Universal LM core with pluggable provider adapters
Project description
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): loadshttps://models.dev/api.json. - Middleware pipeline (
middleware.py): retries/history/cache wrappers. - Completeness harness (
completeness/*): fixture + live probes, score output.
Quick start
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.
# in external package pyproject.toml
[project.entry-points."lm15.providers"]
myprovider = "ulm_x_myprovider:build_adapter"
from lm15 import build_default
lm = build_default(discover_plugins=True)
Optional models.dev hydration
lm = build_default(hydrate_models_dev_catalog=True)
Completeness
python3 completeness/runner.py --mode fixture --fail-under 1.0
python3 completeness/runner.py --mode live --fail-under 0.0
Outputs:
completeness/report.jsoncompleteness/report.md
Packaging and publishing (uv + twine)
# 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_KEYANTHROPIC_API_KEYGEMINI_API_KEYorGOOGLE_API_KEY
Docs
Core
docs/GETTING_STARTED.mddocs/CONCEPTS.mddocs/ARCHITECTURE.mddocs/CONTRACT.mddocs/ERRORS.mddocs/STREAMING.mddocs/COMPLETENESS.mddocs/PRODUCTION_CHECKLIST.md
Provider development
docs/ADAPTER_GUIDE.mddocs/ADD_PROVIDER_GUIDE.mddocs/COOKBOOK_TEMPLATE.md
Cookbooks (learning order)
docs/COOKBOOKS/01-basic-text.mddocs/COOKBOOKS/02-streaming.mddocs/COOKBOOKS/03-tools.mddocs/COOKBOOKS/04-multimodal.mddocs/COOKBOOKS/05-files-batches.mddocs/COOKBOOKS/06-reliability.mddocs/COOKBOOKS/07-external-plugins.mddocs/COOKBOOKS/08-models-dev-hydration.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lm15-0.1.0.tar.gz
(19.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
lm15-0.1.0-py3-none-any.whl
(31.2 kB
view details)
File details
Details for the file lm15-0.1.0.tar.gz.
File metadata
- Download URL: lm15-0.1.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61f0acf25dbedb5336579d1515b33b838c8fdc074625e4383029bbb58ee2f638
|
|
| MD5 |
e7d67e8170c3baf62bb4c5e09b8eae06
|
|
| BLAKE2b-256 |
056eb1622904f3fa61f1c66f13d917706f4264bbf33ca6142d8b137414fb96ac
|
File details
Details for the file lm15-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lm15-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
614f451936d055868e9a5f9dd809946fd61052ccbbfc5bcda4534c10235bc96e
|
|
| MD5 |
d3b1b72105ca4050b1c6db0a4b99e9be
|
|
| BLAKE2b-256 |
15d5cd206cfd22da957cb95a8e05b76452d7d2ad9abf483626169a00326041ad
|