tashfeenahmed/freellmapi
Self-hosted LLM gateway for routing across free tiers and custom endpoints
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
FreeLLMAPI is a single-user, self-hosted inference gateway, not a model runtime. Its TypeScript monorepo separates the server, dashboard, CLI and desktop app into server/, client/, cli/ and desktop/, with a shared/ directory. Clients authenticate with a unified key; the router selects the highest-priority eligible model with a healthy key within its limits. Provider keys are encrypted at rest in SQLite and decrypted in memory for outbound calls. On an upstream 429 or 5xx, the router cools down the affected key and tries the next candidate in the chain.
The protocol adapters sit in front of the same router. The extension point is a custom OpenAI-compatible endpoint, which can point to a remote gateway or a separate local runtime such as llama.cpp, LM Studio, vLLM or Ollama. Model and quota metadata are maintained separately: the gateway verifies catalog downloads against a pinned Ed25519 key before applying updates to its local database, preserving user enablement choices and custom providers. The catalog service is not in the prompt or completion path.
Key Capabilities & Differentiators
The OpenAI-style API covers Chat Completions, Responses, legacy Completions, embeddings, model discovery, images, video, speech and transcription. Anthropic clients can use /v1/messages, Gemini clients get /v1beta surfaces, and opt-in Ollama emulation provides NDJSON chat and generation. Tool calls and structured output parameters are handled at the compatibility layer, but endpoint availability does not mean every upstream model implements every feature. The virtual fusion model fans out to multiple models in parallel, then sends their drafts to a judge model for synthesis.
The catalog lists 87 providers, 736 model families and 1,313 provider/model endpoints, including 1,137 chat and 68 embedding endpoints. Its roughly 10.1 billion monthly tokens represent aggregate listed free-tier capacity, not an allocation for one installation. Usable capacity depends on the keys, quotas and account eligibility available to that user. For example, the Apify media integrations in v0.16.57 use fixed presets and per-run caps, and require an eligible hard-capped Free account with sufficient credit.
Trade-offs & Limitations
Compared with calling the OpenAI API directly, FreeLLMAPI lets one client rotate through multiple providers and local backends without changing SDKs. In return, the operator must manage provider accounts, keys, quotas and fallback behavior. A successful fallback can change which model answers, and retries can add latency, so an automatically routed endpoint is a poor baseline for tests that require a fixed model. Free tiers have no SLA or frontier-model access, and stronger options can drop out as daily quotas are exhausted. fusion also consumes quota across multiple upstream calls rather than one.
Unlike a direct local runtime such as Ollama, this gateway does not itself run models. SQLite encryption protects stored keys at rest, but prompts still go to whichever remote providers serve them. The single-user design and loopback default make it a better personal tool than a shared public gateway. The router is MIT-licensed; provider terms remain separate. Free installations use a signed catalog snapshot delayed by 30 days, while Premium pays for the live feed, not dedicated model capacity or better service guarantees.
Hardware & Deployment Guide
The Docker Compose service uses ghcr.io/tashfeenahmed/freellmapi:latest, reads .env, runs with NODE_ENV=production and serves on port 3001, bound to localhost by default. The dashboard is at http://localhost:3001; add provider keys and configure the fallback chain there, then point an OpenAI client at http://localhost:3001/v1 with the unified key. Source builds require Node >=20.18.0 and <25.0.0, plus npm >=10.0.0. Keep the SQLite data and encryption key together in a protected backup. Windows and macOS desktop builds also bundle the local router and dashboard.
The gateway needs no GPU when it delegates inference to remote providers; size the Node service for concurrent requests and streams, and provision local inference backends separately. Self-hosting does not make remote providers or catalog refreshes offline. Compose also includes an opt-in Watchtower update path that requires the autoupdate profile and WATCHTOWER_TOKEN. In v0.16.56 the Playground gained reasoning controls for supported models and /v1/models gained an option to show only currently runnable models. v0.16.57 expanded eligible Apify video and image generation.
Individual developers experimenting with coding assistants or comparing hosted and local models behind one client configuration.
You need predictable model behavior, guaranteed capacity or latency, multi-tenant isolation, or prompts that must stay on-device while using remote providers.
Quick Start & Installation
npx freellmapi setup-claude --url http://localhost:3001 --api-key <unified-key>
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| freellmapi ★ | 62k | +2.6k | TypeScript | MIT | Self-hosted LLM gateway for routing across free tiers and custom endpoints |
| bifrost | 10.2k | +125 | Go | Apache-2.0 | Self-hosted Go gateway for routing and governing multi-provider LLM traffic |
| gpt-load | 7.2k | +6 | Go | MIT | Self-hosted Go gateway for routing LLM traffic across providers and credentials |
| OmniRoute | 92.1k | +1.5k | TypeScript | MIT | Self-hosted OpenAI-compatible gateway for multi-provider routing and fallback |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/tashfeenahmed/freellmapi.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about freellmapi
How do I connect an existing OpenAI SDK client?
Does the gateway need a GPU or dedicated VRAM?
Does the MIT license make the free provider pool suitable for commercial self-hosting?
When is the direct OpenAI API a better choice?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy