One command. Every free AI model. Zero cost.
Tired of juggling API keys, rewriting boilerplate, and guessing which free model actually works? freeswitch gives you one CLI to switch between, chat with, and benchmark free AI models — no vendor lock-in, no credit card.
pip install fswitch-cli
fswitch use nemotron-ultra
fswitch chat "write a REST API in Python"
fswitch use <alias> and you're done/switch between models mid-chatfswitch agent "build a todo app" — reads/writes files, runs tests, and self-corrects!rich and visual ⠋ Thinking... animationsrequests + rich, nothing heavypip install fswitch-cli
Or from source:
git clone https://github.com/Biya-dev/freeswitch
cd freeswitch
pip install .
Get a free API key from your preferred provider:
Tell freeswitch about it:
fswitch config --key sk-or-v1-your-key-here
# For other providers, use the --provider flag:
# fswitch config --provider anthropic --key sk-ant-...
# fswitch config --provider google --key AIzaSy...
# fswitch config --provider groq --key gsk_...
That's it. You're ready.
fswitch list
fswitch use nemotron-ultra
fswitch chat "explain quicksort in 3 lines"
fswitch chat -m deepseek-r1 "solve this leetcode problem: two sum"
fswitch repl
Inside the REPL:
/switch deepseek-r1 to change model mid-conversation/models to list available modelsexit to quitfswitch agent "create a Python script that fetches weather data"
fswitch agent -m qwen3-coder "refactor this project to use async"
The agent can:
--test flag, and if the tests fail, the AI will automatically fix the code until they pass!Example of autonomous self-correction:
fswitch agent "create a calculator function" --test "pytest tests/test_calc.py"
Every action requires your confirmation before executing.
fswitch benchmark
fswitch benchmark --prompt "write a binary search in Rust"
Races every free model on the same prompt and shows you which is fastest.
| Alias | Provider | Model | Free | Best for |
|---|---|---|---|---|
nemotron-ultra | OpenRouter | NVIDIA Nemotron 3 Ultra 550B | Yes | Reasoning, orchestration |
nemotron-super | OpenRouter | NVIDIA Nemotron 3 Super 120B | Yes | General & agentic workflows |
qwen3-coder | OpenRouter | Qwen3 Coder | Yes | Code generation, repo-scale context |
gemma-4 | OpenRouter | Google Gemma 4 31B | Yes | General multimodal instruction |
laguna | OpenRouter | Poolside Laguna M.1 | Yes | Coding-agent experiments |
laguna-xs | OpenRouter | Poolside Laguna XS 2.1 | Yes | Fast coding-agent tasks |
deepseek-r1 | OpenRouter | DeepSeek R1 | Yes | Reasoning + math |
auto-free | OpenRouter | Auto-Free Router | Yes | Auto-routes to best free model |
gemini-2.5-flash | Gemini 2.5 Flash | Yes | Massive 1M context, 1500 req/day | |
gemini-2.5-pro | Gemini 2.5 Pro | Yes | High intelligence, 50 req/day | |
codestral | Mistral | Codestral | Yes | Native model for code generation |
github-gpt4o | GitHub | GPT-4o | Yes | GitHub integrated access |
github-llama3.3 | GitHub | Llama 3.3 70B Instruct | Yes | Extremely capable open weights |
groq-llama3.1-8b | Groq | Llama 3.1 8B | Yes | Ultra-fast LPU inference |
groq-llama3.3-70b | Groq | Llama 3.3 70B | Yes | Fast and extremely smart |
claude-3.5-sonnet | Anthropic | Claude 3.5 Sonnet | No | Complex agentic tasks (Native Endpoint) |
ollama-llama3 | Ollama | Llama 3 (local) | Yes | Fully offline |
Install Ollama, pull a model, and use it completely offline:
ollama pull llama3
fswitch use ollama-llama3
fswitch chat "hello local model!"
You can also set your API key via environment variable instead of fswitch config:
export OPENROUTER_API_KEY="sk-or-v1-..."
PRs welcome! Here's how to help:
freeswitch/models.py — just add a new dict entryfreeswitch/client.pyPlease open an issue first for bigger changes.
MIT — do whatever you want with it.
If this saved you time, drop a star on the repo!
No reviews yet. Be the first to rate this tool.
Sign in to leave a review.