Skip to main content

freeswitch

tests MIT License Python 3.9+

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 /switch between 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)

  1. Get a free API key from your preferred provider:

  2. 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-r1 to change model mid-conversation
  • /models to list available models
  • exit to 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 Google Gemini 2.5 Flash Yes Massive 1M context, 1500 req/day
gemini-2.5-pro Google 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!

Metadata

Release files for fswitch-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fswitch-cli 0.2.0
File Size Uploaded Provenance Actions
fswitch_cli-0.2.0.tar.gz 22.2 kB Without provenance Details for fswitch_cli-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fswitch-cli 0.2.0
File Interpreter ABI Platform Actions
fswitch_cli-0.2.0-py3-none-any.whl Python 3 none any Details for fswitch_cli-0.2.0-py3-none-any.whl

Total release size: 42.4 kB

Release files / fswitch_cli-0.2.0.tar.gz

Download URL fswitch_cli-0.2.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
409ac7330fc73e899db07572816402c24c8390e61c9b0f79ebaab8b8ee7bfc4f
BLAKE2b-256 checksum
How to use checksums
0fa3b8361bfeef04a67b03d15ba904d1ffb07dc238d61421704376612d4ad882
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / fswitch_cli-0.2.0-py3-none-any.whl

Download URL fswitch_cli-0.2.0-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
350b57bdee880399e8038f311a68cca045f406479941d2acd3f47c1355c68b01
BLAKE2b-256 checksum
How to use checksums
5b7fb0df2694403cc649b1f0e2f086f498a5cc458cd6f85aed385b2a6a8b4999
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for fswitch-cli 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page