Skip to main content

Async LLM backend abstraction with Retry-After aware clients.

Project description

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)

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

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

llm_abstraction-0.1.0.tar.gz (6.1 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.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_abstraction-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 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.1.0.tar.gz
Algorithm Hash digest
SHA256 0ca359e3638d45c76a3a4f6d24a996a9bc2e6887e49c82056e4d83076e08bda3
MD5 0cc0aa586b9fd89df9d9d5e0c03554d0
BLAKE2b-256 4000110994bbb5b4349a95e161d07b03e3995d8d5e69c11291a5ef5a49cde341

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llm_abstraction-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6818b2df1a11f65a88bc12974a99fe56dc59646c2340f83d8cb0f6a6f57e44a7
MD5 f3d4f290c7e1e65d81956d138ef184f7
BLAKE2b-256 7f5ac8b67500a3bd02f260d6af98fc1c54950a84489347fe622b653d78c15c8a

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