LiteLLM proxy for Arato logs
Project description
LiteLLM based proxy for Arato Logs
Use this LiteLLM proxy to send logs data to an Arato monitoring endpoint. All LLM calls going through the proxy will be logged in Arato.
Quick Start
Using uvx (Recommended)
Since this package is not yet published to PyPI, you can use uvx with the local wheel:
# First, build the package
uv build
# Run directly without installation using the local wheel
uvx --from ./dist/arato_proxy-*.whl arato-proxy
# Or with custom configuration
uvx --from ./dist/arato_proxy-*.whl arato-proxy --config custom.yaml --port 8080
Using uv/pip (Development Install)
# Install from source in development mode
uv pip install -e .
# Or install from the built wheel
uv pip install ./dist/arato_proxy-*.whl
# Then run
arato-proxy
Publishing to PyPI (For Maintainers)
To publish a new version to PyPI:
# Create and push a new version tag
git tag v0.1.1
git push origin v0.1.1
# Create a GitHub release from the tag
# This will automatically trigger the GitHub Actions workflow to publish to PyPI
The GitHub Actions workflow will:
- Extract the version from the git tag (removing 'v' prefix if present)
- Update the version in
pyproject.toml - Build the package
- Publish to PyPI using trusted publishing
Once published to PyPI, users will be able to run:
# After publishing to PyPI
uvx arato-proxy
pip install arato-proxy
GitHub Actions
This repository includes automated workflows:
- Test: Runs tests on Python 3.8-3.12 for all PRs and pushes
- Release: Automatically publishes to PyPI when a GitHub release is created
- Version is automatically extracted from the git tag
- No manual version management needed
Setup
Environment Variables
You need to setup environment variables with the following keys:
OPENAI_API_KEY="sk-..."
ARATO_API_URL="https://api.arato.ai/..."
ARATO_API_KEY="ar-..."
You can create a .env file or set them in your environment:
# Generate template .env file
arato-proxy --init-env
Configuration
The proxy uses a YAML configuration file (config.yaml). You can generate a template:
# Generate template config.yaml
arato-proxy --init-config
CLI Usage
The arato-proxy command provides several options:
# Show help
arato-proxy --help
# Start with default settings
arato-proxy
# Start with custom configuration
arato-proxy --config custom.yaml --port 8080
# Generate template files
arato-proxy --init-config # Creates config.yaml
arato-proxy --init-env # Creates .env
Known Issue: Callback Loading
Currently, the Arato callback functionality has a compatibility issue when running via uvx. The proxy will start and work with basic LiteLLM functionality, but the Arato-specific logging callbacks may not load properly in packaged environments. This is being investigated.
For now, you can use the proxy for basic LiteLLM functionality, and the callback issue will be resolved in a future update.
Required Environment Variables
ARATO_API_URL- URL of the Arato API endpointARATO_API_KEY- API key for authenticationOPENAI_API_KEY- OpenAI API key for the proxy
Development
From Source
git clone https://github.com/AratoAi/litellm-proxy
cd litellm
python3 -m venv .venv
source .venv/bin/activate
uv pip install -e .
Running Tests
python -m pytest test_custom_callbacks.py -v
Building the Package
uv build
Installing in Development Mode
uv pip install -e .
Example usage with n8n
In n8n, create a new OpenAI integration and set the base URL to point to your LiteLLM endpoint
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arato_proxy-0.1.0.tar.gz.
File metadata
- Download URL: arato_proxy-0.1.0.tar.gz
- Upload date:
- Size: 63.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c8481216fe526e9ab6e91b392369c71587abc5dc79150ec5cd516d5963cbe0b
|
|
| MD5 |
b59d22221823113f3f19564195901a9c
|
|
| BLAKE2b-256 |
e5e7cb4850aaba214384c125782dbfc51cecdd4d671d6681962fa8d392585344
|
Provenance
The following attestation bundles were made for arato_proxy-0.1.0.tar.gz:
Publisher:
release.yml on AratoAi/litellm-proxy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arato_proxy-0.1.0.tar.gz -
Subject digest:
9c8481216fe526e9ab6e91b392369c71587abc5dc79150ec5cd516d5963cbe0b - Sigstore transparency entry: 276161821
- Sigstore integration time:
-
Permalink:
AratoAi/litellm-proxy@341a4d7debde1d3460adde3450698bc99f702149 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AratoAi
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@341a4d7debde1d3460adde3450698bc99f702149 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file arato_proxy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arato_proxy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa1c80c821da17b7034f2d86fd3fffd7c8a8eb4e1493f39a75a6d959888472a2
|
|
| MD5 |
a56496339e2f40fde63923cf0a111f79
|
|
| BLAKE2b-256 |
05fc9f58a71c9a78dc3318a9680b4a35930000898a4dd093f5f0165514cdcac4
|
Provenance
The following attestation bundles were made for arato_proxy-0.1.0-py3-none-any.whl:
Publisher:
release.yml on AratoAi/litellm-proxy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arato_proxy-0.1.0-py3-none-any.whl -
Subject digest:
aa1c80c821da17b7034f2d86fd3fffd7c8a8eb4e1493f39a75a6d959888472a2 - Sigstore transparency entry: 276161826
- Sigstore integration time:
-
Permalink:
AratoAi/litellm-proxy@341a4d7debde1d3460adde3450698bc99f702149 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AratoAi
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@341a4d7debde1d3460adde3450698bc99f702149 -
Trigger Event:
workflow_dispatch
-
Statement type: