Last updated: · Source and local runtime verified: 1 Nov 2026 (America/Los_Angeles) · Tag v0.16.16 · Commit 21d287a
FreeLLMAPI GitHub: install and deploy from source
FreeLLMAPI is a self-hosted router that puts configured model providers behind a common API and dashboard. Clone the original GitHub repository, check out the pinned commit, create a private encryption key, then start the local UI. Running the built app requires a Node server, SQLite and persistent storage; a static-only host cannot run it.
Unofficial tutorial, not affiliated with or endorsed by FreeLLMAPI or its author. The router does not provide bundled Claude or GPT access. Provider accounts and keys, and their current quotas and terms, remain required for the providers you use. Upstream free-tier catalogue counts and token estimates are claims, not a guaranteed allowance.
For personal experimentation and learning. The upstream README advises against production reliance, and the free tier has no SLA. In this guide, “deploy” means running a self-hosted experiment; do not build production dependencies on it.
Identify the original GitHub project
The original repository is tashfeenahmed/freellmapi, not a fork (fork=false in the dated GitHub API snapshot). Its pinned README links to freellmapi.co, and the website links back to the repository. The code carries an MIT license.
The GitHub API snapshot recorded 45,744 stars on 1 Nov 2026 (America/Los_Angeles). This is a changing count, not a quality or reliability rating. This tutorial targets tag v0.16.16 at the commit listed in Sources.
Prerequisites
- macOS or Linux shell, Git, Node and npm. The actual package engines require Node
>=20.18.0 <25.0.0and npm>=10.0.0; the README's “Node 20+” overview is less precise. The pinned .nvmrc selects Node22; the local verification below used Node24.22.1, which also satisfies these engines. - Writable persistent storage. The server uses SQLite, normally at
server/data/freeapi.db. Keep the database and its matching encryption key across restarts and upgrades. - Provider credentials for actual model requests. Get accounts and API keys directly from your chosen providers. You can inspect the local setup without them, but that does not validate inference.
The source server defaults to :: (all interfaces). The commands here explicitly write HOST=127.0.0.1 to .env to keep the API local. This is an editorial addition for local verification using the option documented in .env.example; see the source configuration for the default. FreeLLMAPI is single-user by design; keep access limited to your machine or a trusted private network.
Install the pinned source
Run this in a directory where a new freellmapi checkout can be created. It adapts the official local-development instructions by pinning the source and refusing to overwrite an existing .env. The generated secret is written directly to a mode-0600 file and is not printed.
(
set -e
git clone https://github.com/tashfeenahmed/freellmapi.git
cd freellmapi
git checkout 21d287aed0aad56cf74bd001d24194916b5a4515
npm install
node <<'NODE'
const fs = require('node:fs');
const { randomBytes } = require('node:crypto');
if (fs.existsSync('.env')) {
console.error('Refusing to overwrite .env. Preserve its encryption key.');
process.exit(1);
}
const fd = fs.openSync('.env', 'wx', 0o600);
try {
fs.writeFileSync(fd,
`ENCRYPTION_KEY=${randomBytes(32).toString('hex')}\nPORT=3001\nHOST=127.0.0.1\n`);
} finally {
fs.closeSync(fd);
}
NODE
)Run the key-generation step only for a new installation. If it refuses an existing file, keep that configuration and continue with your existing key. Preserve ENCRYPTION_KEY on upgrades: replacing it does not re-encrypt saved provider credentials and will make them unreadable. The pinned docs describe a separate key-rotation procedure.
Start the dev UI and understand the credentials
HOST=127.0.0.1 npm run devLeave this terminal running. Open http://localhost:5173 for the Vite UI; the API server is on port 3001. Vite proxies API calls to it, as shown in the Vite configuration.
- Create the first dashboard account: enter an email address and a password of at least eight characters. A loopback browser can complete setup without a code. If the UI requests a setup code, use the First-run setup code printed in the server terminal. Remote setup requires that code; it changes on each unclaimed restart and is cleared after account creation. These rules come from the auth routes and UI form.
- Add provider keys on Keys and review the Fallback Chain. These credentials authorize requests to upstream providers; the dashboard login does not replace them.
- Copy the unified router key from the Keys page header. The
freellmapi-…key authenticates your clients to this router. The documented OpenAI-compatible base URL ishttp://127.0.0.1:3001/v1. See the pinned API reference for request formats.
Your email/password and dashboard session manage administrative /api routes; the unified key serves client /v1 requests. ENCRYPTION_KEY protects stored secrets and is neither of those login credentials. An API protocol or a Claude-style model name does not grant access to the corresponding first-party model.
From a second terminal, this locally verified connectivity check needs no provider key:
curl -fsS http://127.0.0.1:3001/api/pingThe handler returns JSON with status: "ok" and an ISO timestamp when it answers. The local dev and built-server checks both returned HTTP 200. This confirms HTTP reachability only; it does not establish provider readiness or successful inference. /livez checks liveness, while /readyz checks upstream readiness; without configured providers, the verified /readyz response was the expected 503.
Run the built server, or choose Docker
Stop npm run dev with Ctrl+C first to release port 3001. From the checkout root, use the documented build path with an explicit local bind:
npm run build
HOST=127.0.0.1 node server/dist/index.jsOpen http://127.0.0.1:3001: the built dashboard and API share port 3001. Keep the same .env and database. Serving only the dashboard files on a static host does not run the backend.
For a longer-running self-hosted experiment: use a suitable process manager, persistent SQLite storage and backups. Remote hosting and production deployment were not tested, and the upstream production limitation still applies. For remote access, use a trusted private network and suitable TLS/reverse-proxy configuration; do not expose this single-user router directly to the public internet.
Optional Docker Compose alternative — not exercised here
The official docs recommend Compose and list Docker, Docker Compose and OpenSSL as prerequisites. As an alternative to the Node process, stop it first, reuse the private .env created above, and run the documented operations from the checkout:
docker compose up -d
docker compose logs -f freellmapiThe pinned Compose file publishes on 127.0.0.1:3001 and stores SQLite in the freellmapi-data volume. It references the :latest container image: checking out the pinned source does not pin that image. Docker also uses its own database volume rather than your source install's server/data; do not assume the dashboard account or settings transfer automatically. This alternative is documented, not verified in this environment.
Troubleshooting and backup
- Install or start fails: check
node --versionandnpm --versionagainst the engines above, then read the terminal error. macOS/Linux uses the nativebetter-sqlite3dependency, so retain its install diagnostics. If port3001is busy, stop the earlier dev or built process before starting another. - “Database not initialised”: if your shell explicitly sets
NODE_ENV=development, the database initializer asks fornpm run db:migration:up. Stop the server, run that command from the checkout root, then restart. - Forgot the dashboard password: use Forgot password? → Send reset code, read the code in the server terminal (or Docker logs), and submit it with a new password. The documented recovery uses a 15-minute code, not an email. Never delete SQLite or
.envto recover a login. - Provider request fails: check that the provider key is enabled, its account has quota, and the target model is eligible. A visible catalogue entry is not proof of access; even
readycan include an unprobed key, per the model-listing docs. - Decryption fails after moving or upgrading: restore the encryption key that belongs to that database and restart. A replacement random key cannot decrypt existing credentials.
Back up data and the matching key together
Use the dashboard's Backups feature; the backup API refuses restores under a different encryption-key fingerprint. As an editorial filesystem-backup option, stop the source server cleanly before copying its server/data directory and protected .env to secure storage. If you set FREEAPI_DB_PATH, back up that location instead. Preserve any encryption key used by an older development fallback, too.
SQLite contains settings and account state as well as encrypted provider credentials; do not assume the entire database file is encrypted. For Docker, preserve the data volume and matching ENCRYPTION_KEY. The install docs also describe encrypted backup targets for hosts with ephemeral disks.
Verification scope
The source review covers the pinned README, package engines, install and REST API docs, startup, authentication, connectivity and storage configuration. The local runtime checks below separately confirm installation and operation without configured providers.
Local runtime verification — 1 Nov 2026
Verification date: (America/Los_Angeles). Environment: Linux x86_64, Node 24.22.1, npm 11.21.1; tag v0.16.16 at the pinned commit. HTTP checks took place on 2 Nov in UTC, still 1 Nov locally. A temporary dashboard account was created; no provider or paid API keys were used.
| Check | Actual result and scope |
|---|---|
npm install | Exit 0; 838 packages installed. |
npm run dev | Started successfully. UI on :5173/ and its /api/ping proxy returned HTTP 200; API :3001/api/ping and /livez also returned 200. |
| First dashboard account and unified key | Local account creation returned 201; authenticated unified router key retrieval returned 200. Credential values are omitted. |
GET /v1/models | Without a key: 401. With the unified router key: 200, with 82 local catalogue records. Listing models does not confirm they can answer requests. |
POST /v1/chat/completions | With a valid unified key and model=auto: 503, code no_providers_configured. This was the expected no-provider condition; no model answer was generated. |
npm run build | Exit 0; server TypeScript, CLI TypeScript, and client TypeScript/Vite builds all completed. |
node server/dist/index.js | After stopping dev, the exact built-server command started successfully. Built HTML at :3001/, JS/CSS assets, /api/ping and /livez returned 200. |
| Account persistence after build | GET /api/auth/status returned 200 with needsSetup=false, confirming the temporary dashboard account and SQLite state persisted. |
GET /readyz | Dev and built server: 503, reason no_upstreams_configured. Expected without provider keys; inference readiness was not established. |
Dependency observation: npm reported 44 vulnerabilities during installation (1 low, 23 moderate, 15 high, 5 critical). No npm audit fix was run, and their individual reachability and risk were not assessed. Build output included Vite native-config compatibility and bundle-size notices; the build still exited successfully.
The version: 0.4.1 field in /livez is the OpenAPI specification version, not the tested release tag v0.16.16.
Not tested: Docker/Compose execution, real upstream inference or streaming, provider failover, paid API access, coding-client integration, remote hosting or production deployment. Provider-free local checks cannot establish those capabilities.
Sources and related guides
Source snapshot: 1 Nov 2026 (America/Los_Angeles), tag v0.16.16, full commit 21d287aed0aad56cf74bd001d24194916b5a4515. All repository evidence below is pinned to this commit. The repository identity, reciprocal website link and star count use dated GitHub API and website checks from the same local date.
- README and MIT LICENSE — project scope, official website, single-user design and license.
- package.json, .nvmrc and .env.example — exact Node/npm engines, the Node version selection, local bind option and dev/build scripts.
- Install and deploy — source setup, Compose, state, key preservation and password recovery.
- REST API reference — client authentication, model availability and backups.
- Auth routes, setup-code flow and dashboard auth UI — first-run setup and account login.
- Server app, bind configuration, SQLite initialization and Compose file — connectivity, serving, storage and container defaults.
Related guides
- Gemini 4 Neon pricing and comparisons with Astra, Hydrogen and Carbon
- OmniRoute: local AI gateway and agent skills — configure its provider connections, client endpoint and agent instruction manifests.
- DeepSeek Super Agent setup — a separate GitHub coding prototype with its own provider, identity and permission requirements.
- How to use REA with Claude Code or Codex — a separate tool setup guide, not a tested FreeLLMAPI integration.
- All guides on the homepage