LLM Usage Framework
A generic, provider-independent Python framework for tracking LLM usage.
The framework provides a common interface for executing LLM requests and collecting standardized usage telemetry across different LLM providers.
The framework is storage-agnostic. It does not create database tables, manage databases, or require a specific persistence technology.
Applications consuming the package decide how usage data should be stored or exported.
Features
The framework captures:
- Input tokens
- Output tokens
- Total tokens
- Input character count
- Output character count
- Token source
- Provider
- Model
- Request ID
- Session ID
- Latency
- Project
- Service
- Feature
- Custom metadata
Additional capabilities include:
- Generic provider interface
- Provider registry
- Lazy provider loading
- Optional tokenizer support
- Token counting fallback
- Character-based token estimation
- Usage callback
- Provider-specific adapters
- Provider exceptions are propagated to the consuming application
- No persistence dependency
Supported Providers
| Provider | Status | Optional Dependency |
|---|---|---|
| Ollama | Supported | httpx |
| OpenAI | Supported | openai |
| Anthropic | Supported | anthropic |
| Gemini | Planned | google-genai |
| AWS Bedrock | Planned | boto3 |
Providers are implemented as adapters behind the same generic LLMTracker interface.
Architecture
Application
|
v
LLMTracker
|
v
Provider Registry
|
v
Provider Adapter
|
+---- Ollama
+---- OpenAI
+---- Anthropic
+---- Gemini
+---- Bedrock
|
v
Standardized LLMResponse
|
+---- Application Database
+---- Kafka
+---- Prometheus
+---- Logging
+---- Other Systems
Metadata
Release files for llm-usage-framework 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llm_usage_framework-0.1.0.tar.gz | 16.6 kB | Without provenance | Details for llm_usage_framework-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llm_usage_framework-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llm_usage_framework-0.1.0-py3-none-any.whl |
Total release size: 31.7 kB
Release files / llm_usage_framework-0.1.0.tar.gz
| Download URL | llm_usage_framework-0.1.0.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5f3e35bf441b25587aa8d8ac47a3e77991ce11950c4928ade7bef49188164ef
|
|
BLAKE2b-256 checksum How to use checksums |
8e016e0877075ab6a0de45a31b9bd8dd360e0dd74b9d733e2e3a01259c311f9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / llm_usage_framework-0.1.0-py3-none-any.whl
| Download URL | llm_usage_framework-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc38ef492dea5b1ce06450cbb083653dfa40e20b613655d9563c69e319518397
|
|
BLAKE2b-256 checksum How to use checksums |
d885723f061b73ad987a047c2f3e2c0199d580d9e56e41b5f7f3b031d93e9f44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for llm-usage-framework 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.