How sodium16/slmforge works
SLMForge is a demo application that turns a natural-language request into a task-specific small-language-model build. The intended path runs from request analysis and dataset preparation through model selection, baseline, training, evaluation, and deployment; README status notes that only the early stages are implemented, while later stages honestly return 501. The dashboard and API initiate work, with queued jobs handled by a worker. Relationships for unsampled routes and later-stage implementations are shown only where the README documents them; the graph does not imply those stages are complete.
Main entry points: orchestrator.py Stage orchestrator · main.py FastAPI service · api.ts Typed API client · App.tsx Dashboard
Components 27
User experience
- Dashboard
web/src/App.tsx - Project views
web/src/components/ProjectDetail.tsx - Dataset review
web/src/components/DatasetPanel.tsx - Typed API client
web/src/api.ts
API and workflow
- FastAPI service
src/slmforge/main.py - Project and stage routes
src/slmforge/api/routes/projects.py - Stage routes
src/slmforge/api/routes/stages.py - Authentication routes
src/slmforge/api/routes/auth.py - Stage orchestrator
src/slmforge/pipeline/orchestrator.py
Build stages
- Request analysis
src/slmforge/pipeline/analyzer.py - Dataset curation
src/slmforge/pipeline/datasets.py - Model selection
src/slmforge/pipeline/planner.py - Baseline evaluation
src/slmforge/pipeline/baseline.py - Training plan
src/slmforge/pipeline/planner.py - Fine-tuning
src/slmforge/pipeline/trainer.py - Model evaluation
src/slmforge/pipeline/evaluator.py - Endpoint deployment
src/slmforge/pipeline/deployer.py
Jobs and sandbox
- Job queue
src/slmforge/jobs/queue.py - Background worker
src/slmforge/jobs/worker.py - Job handlers
src/slmforge/jobs/handlers.py - Sandbox runtime
src/slmforge/sandbox/base.py
Persistence and integrations
- Project database
src/slmforge/db.py - Hub and data tools
src/slmforge/integrations/hf_cli.py - Planner LLM
src/slmforge/integrations/llm.py
Other components
- Build requester
- Hugging Face
- Callable endpoint
Connections 31
- Build requester → Dashboard: describes need
README.md - Dashboard → Project views: opens project
web/src/App.tsx - Project views → Dataset review: shows curation
web/src/components/ProjectDetail.tsx - Dashboard → Typed API client: requests data
web/src/App.tsx - Project views → Typed API client: requests project data
web/src/components/ProjectDetail.tsx - Dataset review → Typed API client: approves dataset
web/src/components/DatasetPanel.tsx - Typed API client → FastAPI service: sends HTTP requests
README.md - FastAPI service → Project and stage routes: mounts API
src/slmforge/main.py - FastAPI service → Stage routes: mounts API
src/slmforge/main.py - FastAPI service → Authentication routes: mounts API
src/slmforge/main.py - Project and stage routes → Project database: persists projects
- Stage routes → Stage orchestrator: runs stages
- Stage orchestrator → Project database: records runs and events
src/slmforge/pipeline/orchestrator.py - Stage orchestrator → Request analysis: runs stage
- Stage orchestrator → Dataset curation: runs stage
- Stage orchestrator → Model selection: runs stage
- Stage orchestrator → Baseline evaluation: runs stage
- Stage orchestrator → Training plan: runs stage
- Stage orchestrator → Fine-tuning: runs stage
- Stage orchestrator → Model evaluation: runs stage
- Stage orchestrator → Endpoint deployment: runs stage
- Request analysis → Planner LLM: consults planner
README.md - Dataset curation → Hub and data tools: profiles and fetches data
src/slmforge/pipeline/datasets.py - Hub and data tools → Hugging Face: queries Hub
README.md - FastAPI service → Job queue: queues long work
README.md - Background worker → Job queue: claims jobs
src/slmforge/jobs/worker.py - Background worker → Job handlers: dispatches jobs
src/slmforge/jobs/worker.py - Job handlers → Stage orchestrator: runs stage
src/slmforge/jobs/handlers.py - Job handlers → Sandbox runtime: resolves sandbox
src/slmforge/jobs/handlers.py - Endpoint deployment → Callable endpoint: publishes endpoint
README.md - Authentication routes → Hugging Face: signs in
README.md