Skip to main content

A tiny CLI to switch and chat across free AI models with one command.

Project description

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 switchfswitch use <alias> and you're done
  • Interactive REPL — multi-turn conversations with /switch between models mid-chat
  • Autonomous agentfswitch 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 Ultra 253B Yes Complex coding, agentic tasks
nemotron-super OpenRouter NVIDIA Nemotron Super 49B Yes Fast + smart balance
qwen3-coder OpenRouter Qwen3 Coder 480B Yes Code generation, 1M context
deepseek-r1 OpenRouter DeepSeek R1 Yes Reasoning + math
gemini-flash OpenRouter Google Gemini 2.0 Flash Yes Fast responses, vision
llama-3.1-8b OpenRouter Meta Llama 3.1 8B Yes Lightweight tasks
mistral-7b OpenRouter Mistral 7B Yes Efficient all-rounder
qwen-2.5-7b OpenRouter Qwen 2.5 7B Yes Multilingual
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!

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

fswitch_cli-0.1.0.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fswitch_cli-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file fswitch_cli-0.1.0.tar.gz.

File metadata

  • Download URL: fswitch_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for fswitch_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f5220565dcf50461700c4c7aeea42e19956c4b522d14875c3aa807a7115ef1d0
MD5 42d351a8f368e70cf515f54f34f572b6
BLAKE2b-256 105c912166e7058ef7bca0724bc939f27075c1d780b444fba742268402be85f8

See more details on using hashes here.

File details

Details for the file fswitch_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fswitch_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for fswitch_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5fc3e03bab17a745a4826c4f7188817acb2b851d3237fe36531af685a2d305e
MD5 dd37b2d50afd34d62e43c3642883cfbf
BLAKE2b-256 70f246fe958930dd00a1fa21beb05329256d70251e264979f1c09d875550d349

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page