How md-mushfiqur123/lychee works
Lychee is a local LLM runtime and orchestration service with CLI and HTTP entry points, a browser dashboard, model acquisition, inference, and compatibility APIs. A typical flow starts with a user command or API request, reaches the server, resolves or loads a model, and streams a result back. The graph also preserves documented compose, memory, routing, structured-output, and image-generation capabilities. Several subsystem links are based on README documentation because their implementation files were not sampled; those evidence limits are reflected in the edges.
Main entry points: routes.go HTTP routes · sched.go Model scheduler · client.go Go API client · server.go Model acquisition
Components 22
User interfaces
- CLI commands
cmd/cmd.go - Go API client
api/client.go - Dashboard UI
app/ui/app/src/routes/c.$chatId.tsx - UI API and streaming
app/ui/app/src/api.ts
Service API
- HTTP routes
server/routes.go - OpenAI-compatible API
server/routes_openai.go - Anthropic API
server/routes_anthropic.go
Models and inference
- Model acquisition
server/internal/registry/server.go - Model resolution
server/model_resolver.go - Model scheduler
server/sched.go - LLM runtime
llm/server.go - MLX text runtime
x/mlxrunner/pipeline.go - Image generation
x/imagegen/server.go - Model conversion
convert/convert.go
Orchestration features
- Multi-model compose
server/handler_compose.go - Persistent memory
server/memory_store.go - Load-balancing router
server/handler_router.go - Structured output
server/handler_structured.go - Agent and web tools
x/tools/registry.go
Client integrations
- Language SDKs
sdk/python/lychee/client.py
Other components
- User
- Hugging Face
Connections 23
- User → CLI commands: runs commands
- CLI commands → Go API client: uses client
api/client.go - User → Go API client: sends requests
- Go API client → HTTP routes: calls REST API
api/client.go - User → Dashboard UI: opens dashboard
- Dashboard UI → UI API and streaming: requests data
- UI API and streaming → HTTP routes: calls service
- HTTP routes → Model resolution: resolves models
server/routes.go - HTTP routes → Model scheduler: gets runner
server/routes.go - Model scheduler → LLM runtime: runs inference
- Model scheduler → MLX text runtime: runs MLX inference
- HTTP routes → Model acquisition: serves model operations
- Hugging Face → Model acquisition: provides models
- Model acquisition → Model conversion: downloads model files
- HTTP routes → Multi-model compose: routes compose
server/routes.go - HTTP routes → Persistent memory: exposes conversations
server/routes.go - HTTP routes → Load-balancing router: routes management
server/routes.go - HTTP routes → Structured output: routes structured output
server/routes.go - HTTP routes → Agent and web tools: supports tool use
server/routes.go - OpenAI-compatible API → HTTP routes: dispatches handlers
server/routes_openai.go - Anthropic API → HTTP routes: registers API routes
server/routes_anthropic.go - HTTP routes → Image generation: supports image requests
- Language SDKs → HTTP routes: calls service API