revenium-middleware-litellm


Namerevenium-middleware-litellm JSON
Version 0.1.27 PyPI version JSON
download
home_pageNone
SummaryA Python library that meters LiteLLM usage to Revenium.
upload_time2025-08-06 17:27:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords litellm middleware logging token-usage metering revenium
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🤖 Revenium Middleware for LiteLLM

[![PyPI version](https://img.shields.io/pypi/v/revenium-middleware-litellm.svg)](https://pypi.org/project/revenium-middleware-litellm/)
[![Python Versions](https://img.shields.io/pypi/pyversions/revenium-middleware-litellm.svg)](https://pypi.org/project/revenium-middleware-litellm/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A middleware library for metering and monitoring LiteLLM usage in Python applications, supporting both direct client calls and the LiteLLM proxy.

## Features

- **Precise Usage Tracking**: Monitor tokens, costs, and request counts across all LLM API endpoints via LiteLLM.
- **Seamless Integration**:
    - **Client:** Drop-in middleware that works with minimal code changes for `litellm.completion`.
    - **Proxy:** Custom callback middleware for easy integration with the LiteLLM proxy.
- **Flexible Configuration**: Customize metering behavior to suit your application needs.
- **Enhanced Metadata**: Track detailed usage context like trace IDs, task types, and user identifiers.

## Installation

Install the base package along with the specific middleware you need:

```bash
# For LiteLLM client-side metering ONLY
pip install "revenium-middleware-litellm[litellm_client]"

# For LiteLLM proxy metering ONLY
pip install "revenium-middleware-litellm[litellm_proxy]"

# To install BOTH client and proxy middleware support
pip install "revenium-middleware-litellm[litellm_all]"
```

## Usage: LiteLLM Client Middleware

This middleware automatically intercepts `litellm.completion` calls made directly from your Python code.

### Zero-Config Integration

Simply export your `REVENIUM_METERING_API_KEY` (and other relevant Revenium environment variables) and import the middleware module *before* your first call to `litellm.completion`. Your LiteLLM calls will be metered automatically:

```python
import litellm
import os

# Ensure Revenium environment variables (e.g., REVENIUM_METERING_API_KEY) are set
# os.environ["REVENIUM_METERING_API_KEY"] = "YOUR_REVENIUM_METERING_API_KEY"
# os.environ["REVENIUM_PRODUCT_ID"] = "YOUR_REVENIUM_PRODUCT_ID" # Optional, but recommended

# Import the client middleware module to activate patching
import revenium_middleware_litellm_client.middleware

# Now use litellm.completion as usual
response = litellm.completion(
    model="gpt-3.5-turbo",
    messages=[{ "content": "Why is the sky blue?","role": "user"}]
)
print(response.choices[0].message.content)
```

The middleware automatically intercepts LiteLLM API calls and sends metering data to Revenium without requiring changes to your existing `litellm.completion` calls. Make sure to configure the underlying `revenium_middleware` (e.g., set the `REVENIUM_METERING_API_KEY` environment variable) for authentication with the Revenium service.

### Enhanced Tracking with Metadata

For more granular usage tracking and detailed reporting, add the `usage_metadata` parameter directly to your `litellm.completion` call:

```python
import litellm
import revenium_middleware_litellm_client.middleware # Ensure middleware is imported

response = litellm.completion(
    model="gpt-3.5-turbo",
    messages=[{ "content": "Why is the sky blue?","role": "user"}],
    usage_metadata={
         "trace_id": "conv-28a7e9d4",
         "task_type": "summarize-customer-issue",
         "subscriber": {
             "id": "subscriberid-1234567890",
             "email": "user@example.com",
             "credential": {
                 "name": "engineering-api-key",
                 "value": "sk-1234567890abcdef"
             }
         },
         "organization_id": "acme-corp",
         "subscription_id": "startup-plan-Q1",
         "product_id": "saas-app-gold-tier",
         "agent": "support-agent",
    },
)
print(response.choices[0].message.content)
```

#### Metadata Fields

The `usage_metadata` parameter supports the following fields:

| Field                        | Description                                               | Use Case                                                          |
|------------------------------|-----------------------------------------------------------|-------------------------------------------------------------------|
| `trace_id`                   | Unique identifier for a conversation or session           | Group multi-turn conversations into single event for performance & cost tracking                           |
| `task_type`                  | Classification of the AI operation by type of work        | Track cost & performance by purpose (e.g., classification, summarization)                                  |
| `subscriber`                 | Object containing subscriber information                   | Track cost & performance by individual users and their credentials                                          |
| `subscriber.id`              | The id of the subscriber from non-Revenium systems        | Track cost & performance by individual users (if customers are anonymous or tracking by emails is not desired)   |
| `subscriber.email`           | The email address of the subscriber                       | Track cost & performance by individual users (if customer e-mail addresses are known)                      |
| `subscriber.credential`      | Object containing credential information                   | Track cost & performance by API keys and credentials                                                       |
| `subscriber.credential.name` | An alias for an API key used by one or more users         | Track cost & performance by individual API keys                                                            |
| `subscriber.credential.value`| The key value associated with the subscriber (i.e an API key)     | Track cost & performance by API key value (normally used when the only identifier for a user is an API key) |
| `organization_id`            | Customer or department ID from non-Revenium systems       | Track cost & performance by customers or business units                                                    |
| `subscription_id`            | Reference to a billing plan in non-Revenium systems       | Track cost & performance by a specific subscription                                                        |
| `product_id`                 | Your product or feature making the AI call                | Track cost & performance across different products                                                         |
| `agent`                      | Identifier for the specific AI agent                      | Track cost & performance performance by AI agent                                                           |
| `response_quality_score`     | The quality of the AI response (0..1)                     | Track AI response quality                                                                                  |

**All metadata fields are optional**. Adding them enables more detailed reporting and analytics in Revenium.

---

## Usage: LiteLLM Proxy Middleware

This middleware integrates with the LiteLLM proxy using its custom callback mechanism.

### Integration with LiteLLM Proxy Server

To integrate the Revenium middleware with your LiteLLM proxy, you need to do the following in your LiteLLM Proxy Server:

1. Install the middleware (`pip install "revenium-middleware-litellm[litellm_proxy]"`).
2. Ensure Revenium environment variables (e.g., `REVENIUM_METERING_API_KEY`) are set where the proxy runs.
3. Configure your LiteLLM proxy to use the Revenium middleware callback.

#### Configuration

Add the Revenium middleware callback path to your LiteLLM `config.yaml`:

```yaml
model_list:
  - model_name: gpt-3.5-turbo
    litellm_params:
      model: openai/gpt-3.5-turbo # Example using OpenAI provider prefix
      api_key: "os.environ/OPENAI_API_KEY"

general_settings:
  master_key: "sk-1234" # Example API key

litellm_settings:
  # Add the absolute path to the installed middleware's proxy_handler_instance
  callbacks: ["revenium_middleware_litellm_proxy.middleware.proxy_handler_instance"]
  # Example database URL (optional, for LiteLLM's own logging)
  # database_url: "postgresql://user:password@localhost/litellm"
```

> **Important Note on Callbacks**: LiteLLM proxy expects the `callbacks` list to contain importable Python paths to the callback handler instances. Ensure the `revenium-middleware-litellm` package is installed in the Python environment where the LiteLLM proxy runs. You do *not* need an absolute file path if the package is correctly installed.

### Enhanced Tracking with Custom Headers (Proxy)

For more granular usage tracking when using the proxy, add custom HTTP headers to your API requests made *to* the LiteLLM proxy endpoint:

```python
# Example using requests library to call the LiteLLM proxy
import requests
import json

# LiteLLM proxy configuration
proxy_base_url = "http://localhost:4000"  # Your LiteLLM proxy base URL
proxy_url = f"{proxy_base_url}/chat/completions"  # Add specific endpoint as needed
api_key = "sk-1234" # Your LiteLLM proxy API key or virtual key

headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {api_key}",
    # Revenium Custom Headers, uncomment as needed
    # "x-revenium-trace-id": "conv-28a7e9d4",
    # "x-revenium-task-type": "summarize-customer-issue",
    # "x-revenium-organization-id": "acme-corp",
    # "x-revenium-product-id": "saas-app-gold-tier",
    # "x-revenium-agent": "support-agent",
    # "x-revenium-subscriber-email": "user@example.com",
    # "x-revenium-subscriber-id": "subscriberid-1234567890",
    # "x-revenium-subscriber-credential-name": "engineering-api-key",
}

data = {
    "model": "gpt-3.5-turbo",
    "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is the meaning of life?"}
    ]
}

response = requests.post(proxy_url, headers=headers, data=json.dumps(data))

print(response.status_code)
print(response.json())

```

#### Custom HTTP Headers (Proxy)

The proxy middleware supports the following custom HTTP headers:

| Field                        | Description                                               | Use Case                                                          |
|------------------------------|-----------------------------------------------------------|-------------------------------------------------------------------|
| `x-revenium-trace-id`                   | Unique identifier for a conversation or session           | Group multi-turn conversations into single event for performance & cost tracking                           |
| `x-revenium-task-type`                  | Classification of the AI operation by type of work        | Track cost & performance by purpose (e.g., classification, summarization)                                  |
| `x-revenium-subscriber-email`           | The email address of the subscriber                       | Track cost & performance by individual users (if customer e-mail addresses are known)                      |
| `x-revenium-subscriber-id`              | The id of the subscriber from non-Revenium systems        | Track cost & performance by individual users (if customers are anonymous or tracking by emails is not desired)   |
| `x-revenium-subscriber-credential-name` | An alias for an API key used by one or more users         | Track cost & performance by individual API keys                                                            |
| `x-revenium-organization-id`            | Customer or department ID from non-Revenium systems       | Track cost & performance by customers or business units                                                    |
| `x-revenium-subscription-id`            | Reference to a billing plan in non-Revenium systems       | Track cost & performance by a specific subscription                                                        |
| `x-revenium-product-id`                 | Your product or feature making the AI call                | Track cost & performance across different products                                                         |
| `x-revenium-agent`                      | Identifier for the specific AI agent                      | Track cost & performance performance by AI agent                                                           |
| `x-revenium-response-quality-score`     | The quality of the AI response (0..1)                     | Track AI response quality                                                                                  |


**All metadata fields are optional**. Adding them enables more detailed reporting and analytics in Revenium.

All custom headers are optional. Adding them enables more detailed reporting and analytics in Revenium. The proxy middleware extracts these headers from the incoming request.

---

## 🔄 Compatibility

- Python 3.8+
- LiteLLM (Client usage & Proxy v1.15.0+)
- Works with all LLM models and providers supported by LiteLLM

## Logging

This module uses Python's standard logging system, inheriting configuration from the core `revenium_middleware`. You can control the log level by setting the `REVENIUM_LOG_LEVEL` environment variable:

```bash
# Enable debug logging
export REVENIUM_LOG_LEVEL=DEBUG

# Or when running your script (for client middleware)
REVENIUM_LOG_LEVEL=DEBUG python your_script.py

# Or when starting the proxy (for proxy middleware)
REVENIUM_LOG_LEVEL=DEBUG litellm --config /path/to/config.yaml
```

Available log levels:
- `DEBUG`: Detailed debugging information
- `INFO`: General information (default)
- `WARNING`: Warning messages only
- `ERROR`: Error messages only
- `CRITICAL`: Critical error messages only

## License

This project is licensed under the MIT License - see the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "revenium-middleware-litellm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "litellm, middleware, logging, token-usage, metering, revenium",
    "author": null,
    "author_email": "Revenium <info@revenium.io>",
    "download_url": "https://files.pythonhosted.org/packages/89/fd/303ca639c736c46bf84deb7380e72d99a22d29c8e85222dc4a93c1bd5bdc/revenium_middleware_litellm-0.1.27.tar.gz",
    "platform": null,
    "description": "# \ud83e\udd16 Revenium Middleware for LiteLLM\n\n[![PyPI version](https://img.shields.io/pypi/v/revenium-middleware-litellm.svg)](https://pypi.org/project/revenium-middleware-litellm/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/revenium-middleware-litellm.svg)](https://pypi.org/project/revenium-middleware-litellm/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA middleware library for metering and monitoring LiteLLM usage in Python applications, supporting both direct client calls and the LiteLLM proxy.\n\n## Features\n\n- **Precise Usage Tracking**: Monitor tokens, costs, and request counts across all LLM API endpoints via LiteLLM.\n- **Seamless Integration**:\n    - **Client:** Drop-in middleware that works with minimal code changes for `litellm.completion`.\n    - **Proxy:** Custom callback middleware for easy integration with the LiteLLM proxy.\n- **Flexible Configuration**: Customize metering behavior to suit your application needs.\n- **Enhanced Metadata**: Track detailed usage context like trace IDs, task types, and user identifiers.\n\n## Installation\n\nInstall the base package along with the specific middleware you need:\n\n```bash\n# For LiteLLM client-side metering ONLY\npip install \"revenium-middleware-litellm[litellm_client]\"\n\n# For LiteLLM proxy metering ONLY\npip install \"revenium-middleware-litellm[litellm_proxy]\"\n\n# To install BOTH client and proxy middleware support\npip install \"revenium-middleware-litellm[litellm_all]\"\n```\n\n## Usage: LiteLLM Client Middleware\n\nThis middleware automatically intercepts `litellm.completion` calls made directly from your Python code.\n\n### Zero-Config Integration\n\nSimply export your `REVENIUM_METERING_API_KEY` (and other relevant Revenium environment variables) and import the middleware module *before* your first call to `litellm.completion`. Your LiteLLM calls will be metered automatically:\n\n```python\nimport litellm\nimport os\n\n# Ensure Revenium environment variables (e.g., REVENIUM_METERING_API_KEY) are set\n# os.environ[\"REVENIUM_METERING_API_KEY\"] = \"YOUR_REVENIUM_METERING_API_KEY\"\n# os.environ[\"REVENIUM_PRODUCT_ID\"] = \"YOUR_REVENIUM_PRODUCT_ID\" # Optional, but recommended\n\n# Import the client middleware module to activate patching\nimport revenium_middleware_litellm_client.middleware\n\n# Now use litellm.completion as usual\nresponse = litellm.completion(\n    model=\"gpt-3.5-turbo\",\n    messages=[{ \"content\": \"Why is the sky blue?\",\"role\": \"user\"}]\n)\nprint(response.choices[0].message.content)\n```\n\nThe middleware automatically intercepts LiteLLM API calls and sends metering data to Revenium without requiring changes to your existing `litellm.completion` calls. Make sure to configure the underlying `revenium_middleware` (e.g., set the `REVENIUM_METERING_API_KEY` environment variable) for authentication with the Revenium service.\n\n### Enhanced Tracking with Metadata\n\nFor more granular usage tracking and detailed reporting, add the `usage_metadata` parameter directly to your `litellm.completion` call:\n\n```python\nimport litellm\nimport revenium_middleware_litellm_client.middleware # Ensure middleware is imported\n\nresponse = litellm.completion(\n    model=\"gpt-3.5-turbo\",\n    messages=[{ \"content\": \"Why is the sky blue?\",\"role\": \"user\"}],\n    usage_metadata={\n         \"trace_id\": \"conv-28a7e9d4\",\n         \"task_type\": \"summarize-customer-issue\",\n         \"subscriber\": {\n             \"id\": \"subscriberid-1234567890\",\n             \"email\": \"user@example.com\",\n             \"credential\": {\n                 \"name\": \"engineering-api-key\",\n                 \"value\": \"sk-1234567890abcdef\"\n             }\n         },\n         \"organization_id\": \"acme-corp\",\n         \"subscription_id\": \"startup-plan-Q1\",\n         \"product_id\": \"saas-app-gold-tier\",\n         \"agent\": \"support-agent\",\n    },\n)\nprint(response.choices[0].message.content)\n```\n\n#### Metadata Fields\n\nThe `usage_metadata` parameter supports the following fields:\n\n| Field                        | Description                                               | Use Case                                                          |\n|------------------------------|-----------------------------------------------------------|-------------------------------------------------------------------|\n| `trace_id`                   | Unique identifier for a conversation or session           | Group multi-turn conversations into single event for performance & cost tracking                           |\n| `task_type`                  | Classification of the AI operation by type of work        | Track cost & performance by purpose (e.g., classification, summarization)                                  |\n| `subscriber`                 | Object containing subscriber information                   | Track cost & performance by individual users and their credentials                                          |\n| `subscriber.id`              | The id of the subscriber from non-Revenium systems        | Track cost & performance by individual users (if customers are anonymous or tracking by emails is not desired)   |\n| `subscriber.email`           | The email address of the subscriber                       | Track cost & performance by individual users (if customer e-mail addresses are known)                      |\n| `subscriber.credential`      | Object containing credential information                   | Track cost & performance by API keys and credentials                                                       |\n| `subscriber.credential.name` | An alias for an API key used by one or more users         | Track cost & performance by individual API keys                                                            |\n| `subscriber.credential.value`| The key value associated with the subscriber (i.e an API key)     | Track cost & performance by API key value (normally used when the only identifier for a user is an API key) |\n| `organization_id`            | Customer or department ID from non-Revenium systems       | Track cost & performance by customers or business units                                                    |\n| `subscription_id`            | Reference to a billing plan in non-Revenium systems       | Track cost & performance by a specific subscription                                                        |\n| `product_id`                 | Your product or feature making the AI call                | Track cost & performance across different products                                                         |\n| `agent`                      | Identifier for the specific AI agent                      | Track cost & performance performance by AI agent                                                           |\n| `response_quality_score`     | The quality of the AI response (0..1)                     | Track AI response quality                                                                                  |\n\n**All metadata fields are optional**. Adding them enables more detailed reporting and analytics in Revenium.\n\n---\n\n## Usage: LiteLLM Proxy Middleware\n\nThis middleware integrates with the LiteLLM proxy using its custom callback mechanism.\n\n### Integration with LiteLLM Proxy Server\n\nTo integrate the Revenium middleware with your LiteLLM proxy, you need to do the following in your LiteLLM Proxy Server:\n\n1. Install the middleware (`pip install \"revenium-middleware-litellm[litellm_proxy]\"`).\n2. Ensure Revenium environment variables (e.g., `REVENIUM_METERING_API_KEY`) are set where the proxy runs.\n3. Configure your LiteLLM proxy to use the Revenium middleware callback.\n\n#### Configuration\n\nAdd the Revenium middleware callback path to your LiteLLM `config.yaml`:\n\n```yaml\nmodel_list:\n  - model_name: gpt-3.5-turbo\n    litellm_params:\n      model: openai/gpt-3.5-turbo # Example using OpenAI provider prefix\n      api_key: \"os.environ/OPENAI_API_KEY\"\n\ngeneral_settings:\n  master_key: \"sk-1234\" # Example API key\n\nlitellm_settings:\n  # Add the absolute path to the installed middleware's proxy_handler_instance\n  callbacks: [\"revenium_middleware_litellm_proxy.middleware.proxy_handler_instance\"]\n  # Example database URL (optional, for LiteLLM's own logging)\n  # database_url: \"postgresql://user:password@localhost/litellm\"\n```\n\n> **Important Note on Callbacks**: LiteLLM proxy expects the `callbacks` list to contain importable Python paths to the callback handler instances. Ensure the `revenium-middleware-litellm` package is installed in the Python environment where the LiteLLM proxy runs. You do *not* need an absolute file path if the package is correctly installed.\n\n### Enhanced Tracking with Custom Headers (Proxy)\n\nFor more granular usage tracking when using the proxy, add custom HTTP headers to your API requests made *to* the LiteLLM proxy endpoint:\n\n```python\n# Example using requests library to call the LiteLLM proxy\nimport requests\nimport json\n\n# LiteLLM proxy configuration\nproxy_base_url = \"http://localhost:4000\"  # Your LiteLLM proxy base URL\nproxy_url = f\"{proxy_base_url}/chat/completions\"  # Add specific endpoint as needed\napi_key = \"sk-1234\" # Your LiteLLM proxy API key or virtual key\n\nheaders = {\n    \"Content-Type\": \"application/json\",\n    \"Authorization\": f\"Bearer {api_key}\",\n    # Revenium Custom Headers, uncomment as needed\n    # \"x-revenium-trace-id\": \"conv-28a7e9d4\",\n    # \"x-revenium-task-type\": \"summarize-customer-issue\",\n    # \"x-revenium-organization-id\": \"acme-corp\",\n    # \"x-revenium-product-id\": \"saas-app-gold-tier\",\n    # \"x-revenium-agent\": \"support-agent\",\n    # \"x-revenium-subscriber-email\": \"user@example.com\",\n    # \"x-revenium-subscriber-id\": \"subscriberid-1234567890\",\n    # \"x-revenium-subscriber-credential-name\": \"engineering-api-key\",\n}\n\ndata = {\n    \"model\": \"gpt-3.5-turbo\",\n    \"messages\": [\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n        {\"role\": \"user\", \"content\": \"What is the meaning of life?\"}\n    ]\n}\n\nresponse = requests.post(proxy_url, headers=headers, data=json.dumps(data))\n\nprint(response.status_code)\nprint(response.json())\n\n```\n\n#### Custom HTTP Headers (Proxy)\n\nThe proxy middleware supports the following custom HTTP headers:\n\n| Field                        | Description                                               | Use Case                                                          |\n|------------------------------|-----------------------------------------------------------|-------------------------------------------------------------------|\n| `x-revenium-trace-id`                   | Unique identifier for a conversation or session           | Group multi-turn conversations into single event for performance & cost tracking                           |\n| `x-revenium-task-type`                  | Classification of the AI operation by type of work        | Track cost & performance by purpose (e.g., classification, summarization)                                  |\n| `x-revenium-subscriber-email`           | The email address of the subscriber                       | Track cost & performance by individual users (if customer e-mail addresses are known)                      |\n| `x-revenium-subscriber-id`              | The id of the subscriber from non-Revenium systems        | Track cost & performance by individual users (if customers are anonymous or tracking by emails is not desired)   |\n| `x-revenium-subscriber-credential-name` | An alias for an API key used by one or more users         | Track cost & performance by individual API keys                                                            |\n| `x-revenium-organization-id`            | Customer or department ID from non-Revenium systems       | Track cost & performance by customers or business units                                                    |\n| `x-revenium-subscription-id`            | Reference to a billing plan in non-Revenium systems       | Track cost & performance by a specific subscription                                                        |\n| `x-revenium-product-id`                 | Your product or feature making the AI call                | Track cost & performance across different products                                                         |\n| `x-revenium-agent`                      | Identifier for the specific AI agent                      | Track cost & performance performance by AI agent                                                           |\n| `x-revenium-response-quality-score`     | The quality of the AI response (0..1)                     | Track AI response quality                                                                                  |\n\n\n**All metadata fields are optional**. Adding them enables more detailed reporting and analytics in Revenium.\n\nAll custom headers are optional. Adding them enables more detailed reporting and analytics in Revenium. The proxy middleware extracts these headers from the incoming request.\n\n---\n\n## \ud83d\udd04 Compatibility\n\n- Python 3.8+\n- LiteLLM (Client usage & Proxy v1.15.0+)\n- Works with all LLM models and providers supported by LiteLLM\n\n## Logging\n\nThis module uses Python's standard logging system, inheriting configuration from the core `revenium_middleware`. You can control the log level by setting the `REVENIUM_LOG_LEVEL` environment variable:\n\n```bash\n# Enable debug logging\nexport REVENIUM_LOG_LEVEL=DEBUG\n\n# Or when running your script (for client middleware)\nREVENIUM_LOG_LEVEL=DEBUG python your_script.py\n\n# Or when starting the proxy (for proxy middleware)\nREVENIUM_LOG_LEVEL=DEBUG litellm --config /path/to/config.yaml\n```\n\nAvailable log levels:\n- `DEBUG`: Detailed debugging information\n- `INFO`: General information (default)\n- `WARNING`: Warning messages only\n- `ERROR`: Error messages only\n- `CRITICAL`: Critical error messages only\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python library that meters LiteLLM usage to Revenium.",
    "version": "0.1.27",
    "project_urls": {
        "Bug Tracker": "https://github.com/revenium/revenium-middleware-litellm-python/issues",
        "Documentation": "https://github.com/revenium/revenium-middleware-litellm-python/blob/main/README.md",
        "Homepage": "https://github.com/revenium/revenium-middleware-litellm-python"
    },
    "split_keywords": [
        "litellm",
        " middleware",
        " logging",
        " token-usage",
        " metering",
        " revenium"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f5e89d355fb34a3667df6d2cb53e099fe1c656217a45dcc8bfdc3dd36c8ba3b8",
                "md5": "615371cc5a61e5e9c46f52518487f93e",
                "sha256": "b9c09a9674947c7d64cfb16e775f8b157ee09e2e31ba6d39e413352435c130d2"
            },
            "downloads": -1,
            "filename": "revenium_middleware_litellm-0.1.27-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "615371cc5a61e5e9c46f52518487f93e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11218,
            "upload_time": "2025-08-06T17:27:58",
            "upload_time_iso_8601": "2025-08-06T17:27:58.180916Z",
            "url": "https://files.pythonhosted.org/packages/f5/e8/9d355fb34a3667df6d2cb53e099fe1c656217a45dcc8bfdc3dd36c8ba3b8/revenium_middleware_litellm-0.1.27-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "89fd303ca639c736c46bf84deb7380e72d99a22d29c8e85222dc4a93c1bd5bdc",
                "md5": "53ebc6c228d1eac1ec4e508825cb1c43",
                "sha256": "deba3c9d25b64f83214c44bc96281830f95cb213c66d75be4cf5ce653a36e729"
            },
            "downloads": -1,
            "filename": "revenium_middleware_litellm-0.1.27.tar.gz",
            "has_sig": false,
            "md5_digest": "53ebc6c228d1eac1ec4e508825cb1c43",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10432,
            "upload_time": "2025-08-06T17:27:59",
            "upload_time_iso_8601": "2025-08-06T17:27:59.330973Z",
            "url": "https://files.pythonhosted.org/packages/89/fd/303ca639c736c46bf84deb7380e72d99a22d29c8e85222dc4a93c1bd5bdc/revenium_middleware_litellm-0.1.27.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-06 17:27:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "revenium",
    "github_project": "revenium-middleware-litellm-python",
    "github_not_found": true,
    "lcname": "revenium-middleware-litellm"
}
        
Elapsed time: 1.60206s