freelm is a free, always-up LLM client and API gateway for Python and Node.js. It pools free-tier LLM providers like OpenRouter, Gemini, NIM, Groq, Cerebras, and Mistral behind a single OpenAI-compatible interface, offering automatic failover and dynamic model discovery.
# Swap OpenAI() with the drop-in freelm shimfromfreelm.compatimportOpenAI client = OpenAI() # Routes across 6 providers automatically response = client.chat.completions.create(() model="auto", # virtual model routing messages=[{"role": "user", "content": "hi"}] )
// Built-in zero-dependency TypeScript/JS portimport{ OpenAI }from"freelm/compat";constclient =newOpenAI(); // Handled securely with exponential backoff & failoverconstresponse =awaitclient.chat.completions.create({) model: "chat:fast", messages: [{ role: "user", content: "hi" }] }); console.log(response.choices[0].message.content);
Stop managing multiple API keys, quotas, and SDKs. Write your AI logic once and let freelm handle the operations behind the scenes.
Combine OpenRouter, Gemini (AI Studio), NVIDIA NIM, Groq, Cerebras, and Mistral. Multiply your API quota effortlessly.
If one provider rate-limits or crashes, freelm instantly retries with the next available provider. Streaming fails over seamlessly.
Zero code rewrites. Replace your standard OpenAI import with freelm's compatibility wrapper and maintain identical SDK behavior.
Full support for async iteration and real-time token streaming across all underlying providers.
Free models constantly change. freelm dynamically queries endpoints, categorizes virtual models (e.g., chat:fast), and caches them.
Dead or rate-limited keys are temporarily isolated into a cooldown state, preventing wasted requests and reducing overall latency.
Start building immediately
Python (PyPI) • View Package
Node.js (npm) • View Package