AI news and explainers at 7 AM weekdays, plus a Sunday weekly at 8Get it in your inbox

METAL LAB

tashfeenahmed/freellmapi

19,651+153 todayTypeScript

An open-source router that stitches 34 free LLM tiers into one API key so your app never hits a rate limit

FreeLLMAPI is a self-hosted TypeScript server that combines the free tiers of 34 AI providers (Google, Groq, Mistral, OpenRouter, HuggingFace and more) into a single OpenAI-compatible endpoint. It routes each request to whichever free model is available, automatically switches providers when one is rate-limited, and encrypts your provider keys in a local database. The project reports 474 model families and 635 free endpoints, adding up to roughly 7.4 billion free tokens per month across all providers combined.

What it does

  1. What it does: exposes one unified API (/v1/chat/completions and similar OpenAI-style routes) that sits in front of 34 separate free-tier AI providers plus any custom OpenAI-compatible server.
  2. How it works: a router scores available models on speed/reliability, tries the best one first, falls back to the next provider automatically on rate-limit or server errors, and tracks usage per key so you never exceed a provider's free quota.
  3. Setup: a one-line install script runs a Docker container locally; you add provider keys through a web dashboard, then point any OpenAI SDK or coding assistant (Claude Code, Codex CLI, Cursor, etc.) at your local server.
  4. Security model: provider API keys are AES-256-GCM encrypted in a local SQLite database and decrypted only in memory per request; your apps only ever see one unified token.
  5. Scope and caution: the README explicitly labels this a personal-experimentation project, not a production service, since free tiers can change or disappear without notice.

Why it matters

For hobbyists and developers testing AI features, this removes the tedious work of juggling dozens of provider SDKs, keys, and rate limits by hand. It's a useful reference for anyone building request-routing or failover logic for LLM APIs, though the maintainers themselves warn against relying on it for real production traffic.

Terms in this repo

  • OpenAI-compatible endpoint · A server that accepts requests in the same format as OpenAI's API, so existing OpenAI client libraries work without modification
  • Rate limit / 429 · A cap providers put on how many requests or tokens you can send in a given time; exceeding it returns an error
  • Failover · Automatically switching to a backup provider or model when the first one fails or is unavailable
  • AES-256-GCM · An encryption method used to protect stored data, in this case the saved provider API keys
  • MCP server · A protocol interface that lets AI agents query and interact with a tool or service programmatically

Repository description (English)

plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

Open on GitHub

Trending repos

All repos →

Latest from METAL LAB