How prabanta-dev/janas works
Janas is a C toolkit centered on Janas-LLM: users can obtain a model, run it in a terminal chat, expose it through an OpenAI-compatible HTTP server, or connect it to MCP clients and tool services. The graph also preserves the model-loading and GPU execution layer and the documented model-download workflow. Edges reflect README statements and the supplied source index or excerpts; unsampled implementations are represented only where the tree and documentation support the subsystem.
Main entry points: mcp_server.c MCP stdio server · server/main.c HTTP API server · get/main.c Model downloader · llm.h Public LLM API
Components 27
User interfaces
- Terminal chat
src/chat/main.c - HTTP API server
src/server/main.c - HTTP routing
src/server/http.c - Request engine
src/server/engine.c - Conversation store
src/server/store.c
LLM runtime
- Public LLM API
include/janas/llm.h - Model loading
src/llm/model_load.c - Token generation
src/llm/generate.c - GPU execution
src/llm/gpu.c
MCP ecosystem
- MCP client
src/common/mcp_client.c - Chat tool flow
src/chat/mcp_chat.c - Model MCP server
src/mcp/main.c - MCP stdio server
src/common/mcp_server.c
MCP tool services
- Flight tools
src/services/flights/tools.c - Map tools
src/services/maps/tools.c - Weather tools
src/services/weather/tools.c - Git tools
src/services/git/tools.c - GitHub tools
src/services/github/tools.c - Price tools
src/services/prices/tools.c - Earthquake tools
src/services/quakes/tools.c - System tools
src/services/system/tools.c - Wiki tools
src/services/wiki/tools.c
Model acquisition
- Model downloader
src/get/main.c - Model catalog
src/common/catalog.c
Other components
- User
- MCP client app
- Hugging Face
Connections 25
- User → Terminal chat: chats with
- Terminal chat → Public LLM API: calls
src/chat/main.c - User → HTTP API server: sends requests
- HTTP API server → HTTP routing: starts
src/server/main.c - HTTP routing → Request engine: dispatches
- Request engine → Public LLM API: generates with
src/server/engine.c - HTTP API server → Conversation store: configures
- Public LLM API → Model loading: opens models
include/janas/llm.h - Model loading → GPU execution: uses
src/llm/model_load.c - User → Model downloader: requests model
- Model downloader → Model catalog: selects from
src/get/main.c - Model downloader → Hugging Face: downloads from
src/get/main.c - MCP client app → Model MCP server: starts
src/mcp/main.c - Model MCP server → MCP stdio server: serves over stdio
- MCP client app → MCP client: connects through
- Chat tool flow → MCP client: uses
- Flight tools → MCP stdio server: registers tools
- Map tools → MCP stdio server: registers tools
- Weather tools → MCP stdio server: registers tools
- Git tools → MCP stdio server: registers tools
- GitHub tools → MCP stdio server: registers tools
- Price tools → MCP stdio server: registers tools
- Earthquake tools → MCP stdio server: registers tools
- System tools → MCP stdio server: registers tools
- Wiki tools → MCP stdio server: registers tools