A flexible gateway for connecting and managing multiple LLM providers
Project description
LLM AnyGate
A powerful CLI tool that generates LiteLLM proxy projects from simple YAML configurations. Designed to free users from understanding the complexities of the LiteLLM library and quickly create local LLM proxies for use with various AI coding tools.
Overview
LLM AnyGate simplifies the process of setting up LiteLLM proxy servers by providing a simple command-line interface to generate complete, ready-to-run proxy projects with minimal configuration.
Key Features
🚀 Quick Setup - Create a fully configured LiteLLM proxy project with one command
📝 Simple Configuration - Use minimal YAML config instead of complex LiteLLM settings
🔧 Zero Database - Generated proxies run statelessly without database requirements
🖥️ Cross-Platform - Includes both shell scripts (Unix/macOS) and PowerShell (Windows)
🎯 Production Ready - Generates complete project with scripts, config, and documentation
Installation
From PyPI
pip install llm-anygate
For Development (with Pixi)
# Clone the repository
git clone https://github.com/igamenovoer/llm-anygate.git
cd llm-anygate
# Initialize submodules
git submodule update --init --recursive
# Setup development environment with Pixi
pixi install
pixi shell
Quick Start
Step 1: Create a Model Configuration
Create a simple YAML file with your model configurations (model-config.yaml):
model_list:
- model_name: gpt-4o
litellm_params:
model: openai/gpt-4o
api_base: https://api.openai.com/v1
api_key: os.environ/OPENAI_API_KEY
- model_name: claude-3-5-sonnet
litellm_params:
model: anthropic/claude-3-5-sonnet-20241022
api_key: os.environ/ANTHROPIC_API_KEY
- model_name: gemini-pro
litellm_params:
model: gemini/gemini-pro
api_key: os.environ/GEMINI_API_KEY
Step 2: Generate Proxy Project
Use the CLI to generate a complete LiteLLM proxy project:
llm-anygate-cli create \
--project my-proxy \
--model-config model-config.yaml \
--port 4567 \
--master-key "sk-my-secure-key"
Step 3: Start the Proxy Server
cd my-proxy
# Copy and configure environment variables
cp .env.template .env
# Edit .env and add your API keys
# Start the proxy
./start-proxy.sh # On Unix/macOS
.\start-proxy.ps1 # On Windows
Step 4: Use the Proxy
Your proxy is now running at http://localhost:4567 with an OpenAI-compatible API:
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:4567/v1",
api_key="sk-my-secure-key"
)
response = client.chat.completions.create(
model="gpt-4o", # or any model from your config
messages=[{"role": "user", "content": "Hello!"}]
)
Generated Project Structure
The CLI generates a complete project with:
my-proxy/
├── config.yaml # Full LiteLLM configuration
├── .env.template # Template for API keys
├── README.md # Project documentation
├── start-proxy.sh # Unix/macOS start script
├── start-proxy.ps1 # Windows start script
└── .gitignore # Git ignore rules
CLI Usage
Create Command
llm-anygate-cli create [options]
Options:
--project <dir>(required) - Directory to create the project in--model-config <file>(required) - Path to your model configuration YAML--port <number>- Port for the proxy server (default: 4567)--master-key <key>- Master key for API authentication (default: sk-dummy)
Example with Custom Settings
llm-anygate-cli create \
--project /path/to/my-llm-proxy \
--model-config configs/models.yaml \
--port 8080 \
--master-key "sk-production-key-here"
Model Configuration Format
The model configuration is a simple YAML file with a model_list array:
model_list:
- model_name: <name-for-your-app>
litellm_params:
model: <provider>/<model-id>
api_base: <api-endpoint> # Optional
api_key: os.environ/<ENV_VAR_NAME>
# Additional parameters as needed
Supported Providers
- OpenAI and OpenAI-compatible endpoints
- Anthropic (Claude)
- Google (Gemini/Vertex)
- Azure OpenAI
- Local models (Ollama, etc.)
- Any provider supported by LiteLLM
Why LLM AnyGate?
The Problem
Setting up LiteLLM proxy servers requires understanding complex configurations, database setups, and various deployment options. This complexity is a barrier for developers who just want a simple proxy for their AI tools.
The Solution
LLM AnyGate provides a simple CLI that generates everything you need:
- ✅ No database required (stateless operation)
- ✅ Minimal configuration needed
- ✅ Cross-platform start scripts
- ✅ Environment variable management
- ✅ Production-ready settings
Development
Project Structure
llm-anygate/
├── src/llm_anygate/ # Main package source code
│ ├── cli_tool.py # CLI interface
│ ├── config_converter.py # Config conversion logic
│ ├── proxy_generator.py # Project generation
│ └── templates.py # File templates
├── tests/ # Test suite
├── docs/ # Documentation
└── context/ # AI collaboration workspace
Running Tests
pixi run test # Run tests
pixi run test-cov # Run tests with coverage
Code Quality
pixi run lint # Run linting
pixi run format # Format code
pixi run typecheck # Type checking
pixi run quality # Run all checks
Roadmap
- Core CLI tool implementation
- LiteLLM configuration generation
- Cross-platform start scripts
- Environment variable management
- Docker composition generator
- Provider connectivity testing
- Configuration validation
- Web UI for configuration
- Metrics and monitoring integration
- Advanced routing and load balancing
Requirements
- Python 3.11 or higher
- LiteLLM (for running generated proxies)
pip install 'litellm[proxy]'
Security Notes
- Generated projects include
.env.templatefor API keys - Never commit
.envfiles with actual API keys - Always use secure master keys in production
- Generated
.gitignoreexcludes sensitive files
Contributing
Contributions are welcome! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with OmegaConf for robust configuration handling
- Uses Pixi for environment management
- Generates configurations for LiteLLM
- Project structure based on magic-context templates
Contact
- GitHub: @igamenovoer
- Issues: GitHub Issues
Support
For questions, issues, or feature requests, please open an issue on GitHub.
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
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 llm_anygate-1.0.2.tar.gz.
File metadata
- Download URL: llm_anygate-1.0.2.tar.gz
- Upload date:
- Size: 67.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f3771ecedc168ce94388b9c666eb8e7e3671ebedc712eb4636bf62da9b9cd6b
|
|
| MD5 |
18dffe9006d15d822d8e27cce6946ef1
|
|
| BLAKE2b-256 |
218e127ff7716404a7a8fe44ca99f6e4ad5255e275a0b87b2e70bff4e7b1a074
|
File details
Details for the file llm_anygate-1.0.2-py3-none-any.whl.
File metadata
- Download URL: llm_anygate-1.0.2-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d3603c6a9ff9b0f3e6e705dbba18c0e121f71250d7137ef95a213973809718d
|
|
| MD5 |
a268a02d53af2f82d1308a71fb16c541
|
|
| BLAKE2b-256 |
7b8f914d5a82c250ca18acbf265487e8f1d930532c7cfd061d15fe1e8a014578
|