Skip to main content

lmcc — the calling convention for calling a model

When a program calls a function in another language, a calling convention says where each argument goes, how the result comes back, and how each type crosses. A model is another language; lmcc is its calling convention. It lays out each call as an lm15 request and reads each reply back into typed values. It never touches the network.

import lmcc

@lmcc.fn
def answer(question: str) -> str:
    """Answer the question in one sentence."""

xml = lmcc.adapter(messages=[
    lmcc.system("{instruction}\n{% for f in outputs %}<{f.name}>\n{f.value}\n</{f.name}>\n{% endfor %}"),
    lmcc.user("{question}"),
])
plan = answer.bind(xml)
request = plan.render(question="Why is the sky blue?").request("gpt-4.1-mini")   # an lm15 request
plan.read("<Answer>\nRayleigh scattering.\n</Answer>").values   # {'answer': ...}, misspelling repaired and reported

pip install "lmcc[lm15]" adds the typed bridge to lm15 (lmcc_lm15). The tutorial, how-to guides, the normative specification and the conformance corpus are in the repository: https://github.com/MaximeRivest/lmcc

Metadata

Release files for lmcc 0.8.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lmcc 0.8.6
File Size Uploaded
lmcc-0.8.6.tar.gz 150.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lmcc 0.8.6
File Interpreter ABI Platform
lmcc-0.8.6-py3-none-any.whl Python 3 none any Details

Total release size: 265.1 kB

Release files / lmcc-0.8.6.tar.gz

Download URL lmcc-0.8.6.tar.gz
Size 150.5 kB
Tags Source
SHA-256 checksum
How to use checksums
457def91d00185a7a5247bf7c144bf2e52269f5614c62ce81073ffad828ff51b
BLAKE2b-256 checksum
How to use checksums
ffd23df4154091991e64541612c005898ca7eb224638229620fa6a08ab6d08c8
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 Oct 8, 2026.

Transparency log

Release files / lmcc-0.8.6-py3-none-any.whl

Download URL lmcc-0.8.6-py3-none-any.whl
Size 114.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3fc668c7e88d89c32b3ccfa06f6d74b22c00b4a887b6d3c29f386af3b6999e7
BLAKE2b-256 checksum
How to use checksums
220f46b7f338e0becf78948665cbaef4b654719386cd0199fe4b71731d5d206e
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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.8.7

2 release files

This release

0.8.6 This release

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page