Skip to main content

llm-abstraction

Async LLM backend abstraction with shared Retry-After handling.

Only Mistral chat completions are implemented right now, but the package is structured around a generic async backend interface.

from llm_abstraction import MistralBackend

backend = MistralBackend(api_key="...")
response = await backend.chat(
    [
        {"role": "user", "content": "Hello"},
    ],
)
print(response.content)

embeddings = await backend.embed(["Hello"])
print(embeddings.embeddings[0])

Build

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
ruff check .
mypy
pyright
python -m build
twine check dist/*

Publish

TestPyPI:

twine upload --repository testpypi dist/*

PyPI:

twine upload dist/*

After publishing, downstream projects can depend on:

llm-abstraction>=0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_abstraction-0.3.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

llm_abstraction-0.3.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file llm_abstraction-0.3.0.tar.gz.

File metadata

  • Download URL: llm_abstraction-0.3.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for llm_abstraction-0.3.0.tar.gz
Algorithm Hash digest
SHA256 87ffc38b97e5ae310e9f6533f9601209aa3ebeee1e906742acba2f0ed70b1f1e
MD5 09f438abaf2c89dc3622a69ed6984403
BLAKE2b-256 f5916ad5cb92f8a03ef61b10552001e50434f7900e1cf04e02cea6634c6cf3c6

See more details on using hashes here.

File details

Details for the file llm_abstraction-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_abstraction-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4711cf07692e13e3c2d76c2cf518be25a6fda8ade2e957b697b84c6e9f879c5
MD5 81c3ebf7f30ae333ef70f74eca6e4eec
BLAKE2b-256 73311b95b82efc86e3b4a7bda9d2dd9a50c67fbcc62563b8b112351a3ff17f6a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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