A tiny CLI to switch and chat across free AI models with one command.
Project description
freeswitch
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"
Features
- Free by default — ships with 8+ free-tier models ready to go
- One command to switch —
fswitch use <alias>and you're done - Interactive REPL — multi-turn conversations with
/switchbetween models mid-chat - Autonomous agent —
fswitch agent "build a todo app"— reads/writes files, runs commands - Benchmark mode — race all free models against each other on the same prompt
- Local models — works with Ollama for fully offline, private AI
- Tiny footprint — pure Python, just
requests+rich, nothing heavy
Install
pip install fswitch-cli
Or from source:
git clone https://github.com/Biya-dev/freeswitch
cd freeswitch
pip install .
Setup (30 seconds)
-
Get a free API key from your preferred provider:
- OpenRouter (Best for variety)
- Google AI Studio (Best for huge context limits)
- Mistral AI (Best for Codestral)
- GitHub Models (Built into GitHub, uses personal access tokens)
- Groq Cloud (Best for speed)
-
Tell freeswitch about it:
fswitch config --key sk-or-v1-your-key-here
# For other providers, use the --provider flag:
# fswitch config --provider google --key AIzaSy...
# fswitch config --provider groq --key gsk_...
That's it. You're ready.
Usage
List available models
fswitch list
Switch model
fswitch use nemotron-ultra
Chat (single prompt)
fswitch chat "explain quicksort in 3 lines"
fswitch chat -m deepseek-r1 "solve this leetcode problem: two sum"
Interactive REPL (multi-turn)
fswitch repl
Inside the REPL:
- Type naturally to chat
/switch deepseek-r1to change model mid-conversation/modelsto list available modelsexitto quit
Autonomous Agent
fswitch agent "create a Python script that fetches weather data"
fswitch agent -m qwen3-coder "refactor this project to use async"
The agent can:
- Read and write files on your machine
- Run shell commands (with your approval)
- Diagnose errors and self-correct
- Complete multi-step coding tasks autonomously
Every action requires your confirmation before executing.
Benchmark all free models
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.
Supported Models
| 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 |
ollama-llama3 |
Ollama | Llama 3 (local) | Yes | Fully offline |
Local Models with Ollama
Install Ollama, pull a model, and use it completely offline:
ollama pull llama3
fswitch use ollama-llama3
fswitch chat "hello local model!"
Environment Variables
You can also set your API key via environment variable instead of fswitch config:
export OPENROUTER_API_KEY="sk-or-v1-..."
Contributing
PRs welcome! Here's how to help:
- Add a model: edit
freeswitch/models.py— just add a new dict entry - Add a provider: add a new function in
freeswitch/client.py - Report issues: open an issue
Please open an issue first for bigger changes.
License
MIT — do whatever you want with it.
If this saved you time, drop a star on the repo!
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 fswitch_cli-0.2.0.tar.gz.
File metadata
- Download URL: fswitch_cli-0.2.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
409ac7330fc73e899db07572816402c24c8390e61c9b0f79ebaab8b8ee7bfc4f
|
|
| MD5 |
9f7725124023b4701fca6b73f957a9d2
|
|
| BLAKE2b-256 |
0fa3b8361bfeef04a67b03d15ba904d1ffb07dc238d61421704376612d4ad882
|
File details
Details for the file fswitch_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fswitch_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
350b57bdee880399e8038f311a68cca045f406479941d2acd3f47c1355c68b01
|
|
| MD5 |
e4e74b1c263ffce28edecc905c83844c
|
|
| BLAKE2b-256 |
5b7fb0df2694403cc649b1f0e2f086f498a5cc458cd6f85aed385b2a6a8b4999
|