FreeRouter
🛠️ LiteLLM Configuration Management Tool - Automated Multi-Provider Configuration Generation
What is this?
FreeRouter is a configuration management tool for LiteLLM.
Core Features:
- 📋 Automatically fetch model lists from Provider APIs
- ⚙️ Generate LiteLLM
config.yamlconfiguration files - 🚀 One-command startup of LiteLLM service
Important:
- FreeRouter does not provide AI services; all APIs and routing are provided by LiteLLM
- Recommend reading LiteLLM Documentation first
- If you're familiar with writing LiteLLM configs manually, you may not need FreeRouter
Supported Providers
| Provider | Type | Free |
|---|---|---|
| OpenRouter | Text, Vision, Multimodal | ✅ Partially Free |
| iFlow | Text | ✅ Fully Free |
| ModelScope | Text | ✅ Free Quota |
| OAI | Any (OpenAI-compatible) | Depends |
| Ollama | Text, Vision | ✅ Local Free |
| Static | Any | Depends |
Free Providers:
- OpenRouter (https://openrouter.ai/) - 30+ free models (GPT-3.5, Gemini, Llama, etc.)
- iFlow (https://iflow.cn/) - Chinese free models (Qwen, GLM, DeepSeek, etc.)
Quick Start
1. Installation
pip install freerouter
Or from source:
git clone https://github.com/mmdsnb/freerouter.git
cd freerouter
pip install -e .
2. Initialize Configuration
freerouter init
3. Configure Providers
Edit .env to add API keys:
OPENROUTER_API_KEY=sk-or-v1-xxxxx
IFLOW_API_KEY=sk-xxxxx
Edit config/providers.yaml to enable services:
providers:
# OpenRouter - Free models
- type: openrouter
enabled: true
api_key: ${OPENROUTER_API_KEY}
# iFlow - Chinese free models
- type: iflow
enabled: true
api_key: ${IFLOW_API_KEY}
# Ollama - Local models
- type: ollama
enabled: true
api_base: http://localhost:11434
# ModelScope - Chinese models (2000 calls/day free)
- type: modelscope
enabled: false
api_key: ${MODELSCOPE_API_KEY}
# OAI - Generic OpenAI-compatible API (auto-fetch models)
- type: oai
name: myservice
enabled: false
api_base: https://api.example.com/v1
api_key: ${MYSERVICE_API_KEY}
# Static - Custom service (single model, manual config)
- type: static
enabled: false
model_name: gpt-3.5-turbo
provider: openai
api_base: https://your-api.com/v1
api_key: ${YOUR_KEY}
4. Start Service
# Fetch models and start service
freerouter
# Or step by step
freerouter fetch # Fetch model list
freerouter start # Start service
Service will start at http://localhost:4000.
5. Use API
All API usage follows LiteLLM Documentation.
# List available models
curl http://localhost:4000/v1/models
# Call model (OpenAI-compatible API)
curl http://localhost:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"model": "google/gemini-pro",
"messages": [{"role": "user", "content": "Hello"}]
}'
CLI Commands
freerouter # Start service (default, auto fetch + start)
freerouter init # Initialize config directory
freerouter fetch # Fetch model list and generate config
freerouter start # Start LiteLLM service (daemon mode)
freerouter stop # Stop LiteLLM service
freerouter status # Show service status (PID, URL, uptime, models)
freerouter reload # Reload service (restart)
freerouter reload -r # Reload with refresh (backup + fetch + restart)
freerouter restore <backup-file> # Restore config from backup
freerouter restore <backup-file> -y # Restore without confirmation
freerouter logs # Show service logs in real-time
freerouter list # List configured models (grouped by provider)
freerouter select # Interactive model selector (filter config to selected models)
freerouter --version # Show version
freerouter --help # Show help
Config file search order:
./config/providers.yaml(current directory)~/.config/freerouter/providers.yaml(user config)
License
MIT License - see LICENSE
Links
For issues, please visit Issues
Metadata
Release files for freerouter 0.1.5
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 | |
|---|---|---|---|---|
| freerouter-0.1.5.tar.gz | 307.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| freerouter-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 336.9 kB
Release files / freerouter-0.1.5.tar.gz
| Download URL | freerouter-0.1.5.tar.gz |
|---|---|
| Size | 307.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9133431cda0a65884eada896749d1765330356e3dbf72644350628b348e1573
|
|
BLAKE2b-256 checksum How to use checksums |
f426d7745365f651c500b043d90832e9de74762df072a861087ab700b8f5f926
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 28, 2025.
Transparency logRelease files / freerouter-0.1.5-py3-none-any.whl
| Download URL | freerouter-0.1.5-py3-none-any.whl |
|---|---|
| Size | 29.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
376766d7732a598ee60dc3619c9f22c04bd0f5430f60f8d1608bb2ee8f8e63f7
|
|
BLAKE2b-256 checksum How to use checksums |
970266f0e5e935518b646bde48035ff5465a80a282ea8f8cd56f337f34033870
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 28, 2025.
Transparency logSecurity for freerouter 0.1.5
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for freerouter-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 28, 2025.
Transparency logA 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.