How tashfeenahmed/freellmapi works
FreeLLMAPI aggregates free and custom model providers behind an OpenAI-compatible API, with a dashboard and CLI for configuration and use. The principal workflow is a client request entering the server, being routed across available provider keys and endpoints, and returning a result with usage tracked against provider limits. Separate capabilities include catalog updates, media and embedding APIs, search, prompt compression, and analytics. The graph combines README-documented behavior with source-index references and excerpts; some subsystem links are therefore omitted where implementation wiring was not shown.
Main entry points: app.ts HTTP Application · router.ts Request Router · proxy.ts Chat Proxy API · base.ts Provider Adapters
Components 24
Client Entry Points
- OpenAI Clients
- Web Dashboard
client/src/App.tsx - Agent CLI Setup
cli/src/index.ts
API and Routing
- HTTP Application
server/src/app.ts - Chat Proxy API
server/src/routes/proxy.ts - Responses API
server/src/routes/responses.ts - Anthropic API
server/src/routes/anthropic.ts - Fallback API
server/src/routes/fallback.ts - Request Router
server/src/services/router.ts - Authentication
server/src/routes/auth.ts
Models and Providers
- Provider Adapters
server/src/providers/base.ts - OpenAI-Compatible Adapter
server/src/providers/openai-compat.ts - Model Catalog
server/src/services/catalog-sync.ts - Signed Catalog Feed
Additional Capabilities
- Prompt Compression
server/src/services/compression/pipeline.ts - Web Search
server/src/routes/search.ts - Embeddings API
server/src/routes/embeddings.ts - Media APIs
server/src/routes/media.ts
State and Usage
- Key Management
server/src/routes/keys.ts - Application Database
server/src/db/index.ts - Provider Quotas
server/src/services/provider-quota.ts - Rate Limits
server/src/services/ratelimit.ts - Request Analytics
server/src/routes/analytics.ts - Client Profiles
server/src/routes/client-profiles.ts
Connections 28
- OpenAI Clients → HTTP Application: sends API requests
README.md - Web Dashboard → HTTP Application: uses management API
- Agent CLI Setup → OpenAI Clients: configures clients
README.md - HTTP Application → Chat Proxy API: mounts API routes
server/src/app.ts - HTTP Application → Responses API: mounts API routes
server/src/app.ts - HTTP Application → Anthropic API: mounts API routes
server/src/app.ts - HTTP Application → Fallback API: mounts API routes
server/src/app.ts - Chat Proxy API → Request Router: routes inference
README.md - Responses API → Request Router: routes inference
- Anthropic API → Request Router: routes inference
- Fallback API → Request Router: routes fallback
- Request Router → Provider Adapters: dispatches requests
server/src/services/router.ts - Provider Adapters → OpenAI-Compatible Adapter: extends adapter
server/src/providers/router9.ts - Request Router → Application Database: reads settings
server/src/services/router.ts - Request Router → Provider Quotas: checks usage limits
server/src/services/router.ts - Request Router → Rate Limits: checks request limits
server/src/services/router.ts - Provider Adapters → Provider Quotas: records observations
server/src/providers/router9.ts - Key Management → Application Database: stores key records
- HTTP Application → Key Management: mounts management route
server/src/app.ts - HTTP Application → Request Analytics: mounts analytics route
server/src/app.ts - Signed Catalog Feed → Model Catalog: provides signed updates
README.md - Model Catalog → Request Router: supplies model catalog
- HTTP Application → Web Search: mounts search route
server/src/app.ts - HTTP Application → Embeddings API: mounts embeddings route
server/src/app.ts - HTTP Application → Media APIs: mounts media route
server/src/app.ts - HTTP Application → Authentication: mounts auth route
server/src/app.ts - HTTP Application → Client Profiles: mounts profile route
server/src/app.ts - Chat Proxy API → Prompt Compression: compresses prompts