How golapkamal/free-llm-api works
FreeLLMAPI combines a local dashboard and desktop shell with an OpenAI-compatible inference gateway. A client sends requests to the server’s API routes; the router selects a provider using model, quota, and scoring information, then proxies inference. Separate API branches handle embeddings, media, and synthesis, while management routes expose keys, catalog, analytics, and configuration. The README documents these product capabilities; sampled source and the SOURCE INDEX support only some internal links, so unsampled relationships are omitted rather than inferred.
Main entry points: app.ts HTTP application · router.ts Model router · embeddings.ts Embedding routing · proxy.ts Chat and proxy APIs
Components 24
Dashboard
- Dashboard UI
client/src/App.tsx - Key management UI
client/src/components/keys/provider-list.tsx - Model and playground UI
client/src/pages/PlaygroundPage.tsx
API gateway
- HTTP application
server/src/app.ts - Chat and proxy APIs
server/src/routes/proxy.ts - Responses API
server/src/routes/responses.ts - Anthropic API
server/src/routes/anthropic.ts - Keys API
server/src/routes/keys.ts - Embeddings API
server/src/routes/embeddings.ts - Media API
server/src/routes/media.ts - Fusion API
server/src/services/fusion.ts
Inference
- Model router
server/src/services/router.ts - Provider adapters
server/src/providers - Provider transport
server/src/lib/proxy.ts - Embedding routing
server/src/services/embeddings.ts
State and management
- Catalog synchronization
server/src/services/catalog-sync.ts - Quota and rate limits
server/src/services/ratelimit.ts - SQLite database
server/src/db/index.ts - Key encryption
server/src/lib/crypto.ts - Usage analytics
server/src/routes/analytics.ts
Desktop app
- Desktop controller
desktop/src/main.ts - Dashboard window
desktop/src/window.ts - System tray
desktop/src/tray.ts
Other components
- API client
Connections 25
- API client → Chat and proxy APIs: sends requests
- API client → Responses API: sends requests
- API client → Anthropic API: sends requests
- HTTP application → Chat and proxy APIs: mounts route
server/src/app.ts - HTTP application → Responses API: mounts route
server/src/app.ts - HTTP application → Anthropic API: mounts route
server/src/app.ts - HTTP application → Keys API: mounts route
server/src/app.ts - HTTP application → Embeddings API: mounts route
server/src/app.ts - HTTP application → Media API: mounts route
server/src/app.ts - Chat and proxy APIs → Model router: routes inference
- Responses API → Model router: uses same router
- Anthropic API → Model router: uses same router
- Model router → Provider adapters: resolves provider
server/src/services/router.ts - Model router → SQLite database: reads routing state
server/src/services/router.ts - Model router → Quota and rate limits: checks quotas
server/src/services/router.ts - Embeddings API → Embedding routing: invokes service
server/src/routes/embeddings.ts - Embedding routing → SQLite database: reads keys and models
server/src/services/embeddings.ts - Embedding routing → Key encryption: decrypts keys
server/src/services/embeddings.ts - Embedding routing → Provider transport: sends embedding request
server/src/services/embeddings.ts - Keys API → Key encryption: encrypts keys
- HTTP application → SQLite database: initializes store
server/src/index.ts - HTTP application → Catalog synchronization: starts synchronization
server/src/index.ts - Dashboard UI → Keys API: manages keys
- Desktop controller → System tray: builds tray
desktop/src/main.ts - System tray → Dashboard window: opens window
desktop/src/tray.ts