Skip to main content

No project description provided

Project description

bulkllm

Enhancements over vanilla LiteLLM

bulkllm builds on top of litellm and adds a few extras:

  • Automatic model registration. The package knows how to fetch the list of models from OpenAI, Anthropic, Gemini and OpenRouter and registers them with LiteLLM. Results are cached on disk so they can be reused offline.
  • Centralised rate limiting. A RateLimiter implementation enforces RPM, TPM, input and output token limits per model (or regex group) and works with both async and sync code.
  • Retry‑aware completion wrappers. Thin wrappers around litellm.completion/acompletion integrate Tenacity retries, rate limiting and usage tracking.
  • Usage tracking with statistics. Per‑model usage is tracked in memory with histograms, percentiles and cost calculations via the UsageTracker and UsageStat helpers.
  • Predefined LLM configurations. A large catalogue of model presets with cost information and convenient selection helpers is included.

Development

Always run make checku before committing.

Quick Commands

  • make init create the environment and install dependencies
  • make help see available commands
  • make autoformat format code
  • make autoformat-unsafe format code - including 'unsafe' fixes
  • make lint run linter
  • make typecheck run type checker
  • make test run tests
  • make coverage run tests with coverage report
  • make check run all checks (format, lint, typecheck, test)
  • make checku run all checks (format-unsafe, lint, typecheck, test)

Code Conventions

Testing

  • Use pytest (no test classes).
  • Always set match= in pytest.raises.
  • Prefer monkeypatch over other mocks.
  • Mirror the source-tree layout in tests/.
  • Always run make checku after making changes.

Exceptions

  • Catch only specific exceptions—never blanket except: blocks.
  • Don’t raise bare Exception.

Python

  • Manage env/deps with uv (uv add|remove, uv run -- …).
  • No logging config or side-effects at import time.
  • Keep interfaces (CLI, web, etc.) thin; put logic elsewhere.
  • Use typer for CLI interfaces, fastapi for web interfaces, and pydantic for data models.

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

bulkllm-0.5.3.tar.gz (221.0 kB view details)

Uploaded Source

Built Distribution

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

bulkllm-0.5.3-py3-none-any.whl (128.7 kB view details)

Uploaded Python 3

File details

Details for the file bulkllm-0.5.3.tar.gz.

File metadata

  • Download URL: bulkllm-0.5.3.tar.gz
  • Upload date:
  • Size: 221.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for bulkllm-0.5.3.tar.gz
Algorithm Hash digest
SHA256 94471e9031d2cbad022b872aa5f53210243ece0e8e5a0cbf0d530ff8732b1d8b
MD5 f08dd273f32848f9aa76168b85b254c7
BLAKE2b-256 f5a9f7f0b215ad5e5df67d723a92f0b4f2c7717c39bb164efac3ec49d85cb350

See more details on using hashes here.

File details

Details for the file bulkllm-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: bulkllm-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 128.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for bulkllm-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ddca28dfde7f056b49d0e4565638f1e34db0903674317b254fbd1b8996b9220
MD5 2da1322a1e37854be74231cd9d7f5db6
BLAKE2b-256 bdc52ebe0abe0cb209a0d08808fc3df531680a530614b8f33b64bd0cffbb4d60

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