open source · MIT · Python 3.9+

Keep free AI models working.

Free AI services cap how often you can use each model, so a long job can die partway through. llm-free-rotator automatically jumps to the next free model when one gets cut off — and tells you which one actually answered.

$ pip install llm-free-rotator

90-second tour

Try it live

Send a prompt and watch it land on a free model. If the top model is rate-limited, it rotates to the next one automatically — no key needed here.

Provider

Free models only · rate-limited demo

Use it in your code

Three lines. Bring your own free-tier key; the library never spends paid credit.

from llm_free_rotator import OpenRouterRotator

r = OpenRouterRotator(api_key="sk-or-v1-...")
res = r.chat([
    {"role": "user", "content": "Explain TLS in one sentence."}
])

print(res.text)      # the answer
print(res.model)     # which free model actually answered

Or from the terminal:

$ llm-rotate chat "Say hi" --provider openrouter

Works with three free services

OpenRouter
dozens of :free models
Groq
fast free dev tier
NVIDIA NIM
free integrate endpoint

Free models only — it won't touch your paid credits. Remembers what worked last time so the next request is quicker.