Free LLM Router Service based on LiteLLM
Project description
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
freerouter list # List configured 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
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 freerouter-0.1.1.tar.gz.
File metadata
- Download URL: freerouter-0.1.1.tar.gz
- Upload date:
- Size: 282.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d91a0fcb2add152ec9c22ecab1a01622e0310ee7b304ece6cf6e5851cee5bdb
|
|
| MD5 |
3a88fb8dd5bb619cb3862396b321b509
|
|
| BLAKE2b-256 |
9a629e604676a5239d0d775d0f4469423b3396c68a413df6916e15f73cc32522
|
Provenance
The following attestation bundles were made for freerouter-0.1.1.tar.gz:
Publisher:
publish.yml on mmdsnb/freerouter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freerouter-0.1.1.tar.gz -
Subject digest:
6d91a0fcb2add152ec9c22ecab1a01622e0310ee7b304ece6cf6e5851cee5bdb - Sigstore transparency entry: 779721253
- Sigstore integration time:
-
Permalink:
mmdsnb/freerouter@463f0f21945d60eaf21858b2bd72eb3313f534cd -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mmdsnb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@463f0f21945d60eaf21858b2bd72eb3313f534cd -
Trigger Event:
release
-
Statement type:
File details
Details for the file freerouter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: freerouter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27c5322d112e5aeef9699dbf902edec3933194c9b788befca45947b27580eaed
|
|
| MD5 |
f0fad16938d5bd88ce86d6985fb2ff48
|
|
| BLAKE2b-256 |
fcaab09d2c90bf64baed3c184d8db3bc3db3123849794d0f03263e301389befa
|
Provenance
The following attestation bundles were made for freerouter-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on mmdsnb/freerouter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freerouter-0.1.1-py3-none-any.whl -
Subject digest:
27c5322d112e5aeef9699dbf902edec3933194c9b788befca45947b27580eaed - Sigstore transparency entry: 779721254
- Sigstore integration time:
-
Permalink:
mmdsnb/freerouter@463f0f21945d60eaf21858b2bd72eb3313f534cd -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mmdsnb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@463f0f21945d60eaf21858b2bd72eb3313f534cd -
Trigger Event:
release
-
Statement type: