How mattey2026/unsloth works
Unsloth is a desktop and web application for running, training, and deploying local AI models, with Unsloth Core as another interface. A typical Studio workflow starts with a user request, passes through backend routes to inference orchestration and a selected model engine, and returns generated output. The repository also has distinct model/dataset management, training, export, Data Recipes, RAG and research capabilities. Edges reflect the documented product flow and sampled engine behavior; many feature-specific route-to-service connections are not established by the excerpts and are omitted.
Main entry points: main.py Backend API · orchestrator.py Inference orchestration · inference.py Inference routes · diffusion_engine_router.py Diffusion engine selection
Components 26
Studio interface
- Studio web UI
studio/frontend/src - Backend API
studio/backend/main.py
Models and inference
- Inference routes
studio/backend/routes/inference.py - Inference orchestration
studio/backend/core/inference/orchestrator.py - Diffusion engine selection
studio/backend/core/inference/diffusion_engine_router.py - Diffusion runtime
studio/backend/core/inference/diffusion.py - Native diffusion engine
studio/backend/core/inference/sd_cpp_engine.py - Local LLM runtime
studio/backend/core/inference/llama_cpp.py - Model and dataset routes
studio/backend/hub/routes - Hub services
studio/backend/hub/services - Cloud providers
studio/backend/core/inference/providers.py
Training and data
- Training routes
studio/backend/routes/training.py - Training runtime
studio/backend/core/training/training.py - Data Recipe routes
studio/backend/routes/data_recipe - Data Recipe service
studio/backend/core/data_recipe/service.py - Export routes
studio/backend/routes/export.py - Export runtime
studio/backend/core/export/orchestrator.py
Knowledge and accounts
- RAG routes
studio/backend/routes/rag.py - RAG pipeline
studio/backend/core/rag/ingestion.py - Research routes
studio/backend/routes/research_runs.py - Authentication
studio/backend/auth/authentication.py
State and storage
- Model files and caches
studio/backend/hub/storage - Auth database
studio/backend/auth/storage.py - Chat history storage
studio/backend/storage/studio_db.py
Other components
- User
- Model provider
Connections 26
- User → Studio web UI: uses
- Studio web UI → Backend API: sends requests
- Backend API → Inference routes: dispatches
- Inference routes → Inference orchestration: runs inference
- Inference orchestration → Local LLM runtime: runs local LLM
- Inference orchestration → Diffusion engine selection: selects engine
- Diffusion engine selection → Diffusion runtime: selects GPU engine
- Diffusion engine selection → Native diffusion engine: selects native engine
- Inference routes → Studio web UI: returns output
- Backend API → Model and dataset routes: dispatches
- Model and dataset routes → Hub services: handles requests
- Hub services → Model files and caches: reads and writes
- Backend API → Training routes: dispatches
- Training routes → Training runtime: starts training
- Backend API → Data Recipe routes: dispatches
- Data Recipe routes → Data Recipe service: handles recipes
- Backend API → Export routes: dispatches
- Export routes → Export runtime: starts export
- Backend API → RAG routes: dispatches
- RAG routes → RAG pipeline: ingests documents
- Backend API → Research routes: dispatches
- Backend API → Authentication: authenticates
- Authentication → Auth database: reads and writes
- Inference orchestration → Chat history storage: persists conversations
- Inference orchestration → Cloud providers: uses optional providers
- Cloud providers → Model provider: requests inference