Skip to main content

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): loads https://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.json
  • completeness/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_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

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lm15-0.1.0-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

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

Hashes for lm15-0.1.0.tar.gz
Algorithm Hash digest
SHA256 61f0acf25dbedb5336579d1515b33b838c8fdc074625e4383029bbb58ee2f638
MD5 e7d67e8170c3baf62bb4c5e09b8eae06
BLAKE2b-256 056eb1622904f3fa61f1c66f13d917706f4264bbf33ca6142d8b137414fb96ac

See more details on using hashes here.

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

Hashes for lm15-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 614f451936d055868e9a5f9dd809946fd61052ccbbfc5bcda4534c10235bc96e
MD5 d3b1b72105ca4050b1c6db0a4b99e9be
BLAKE2b-256 15d5cd206cfd22da957cb95a8e05b76452d7d2ad9abf483626169a00326041ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page