How cocktailpeanut/dalai works
Dalai is a local LLaMA/Alpaca runner with model installation, a web UI, and JavaScript/Socket.io APIs. The main workflow is to install a model, launch the server, and send prompts for streamed inference from the local model executable. The graph also preserves the documented programmatic and remote API capabilities. Some central orchestration code is excerpted only in part, so uncertain engine-dispatch relationships are shown as unverified rather than asserted.
Main entry points: index.js Dalai core · web/index.js Web server · llama.js LLaMA engine · alpaca.js Alpaca engine
Components 14
Entry points
- Command CLI
bin/cli.js - Dalai core
index.js
Model provisioning
- LLaMA engine
llama.js - Alpaca engine
alpaca.js - Torrent downloader
torrent.js - Local model files
- Model sources
Inference runtime
- Model executable
User interfaces
- Web server
bin/web/index.js - Web UI
bin/web/views/index.ejs - Prompt files
bin/web/prompts - Socket.io client
index.js
Other components
- Operator
- Browser user
Connections 18
- Operator → Command CLI: runs commands
bin/cli.js - Command CLI → Dalai core: calls methods
bin/cli.js - Command CLI → Web server: starts server
bin/cli.js - Dalai core → LLaMA engine: dispatches install
index.js - Dalai core → Alpaca engine: dispatches install
index.js - LLaMA engine → Model sources: downloads weights
llama.js - Alpaca engine → Model sources: downloads weights
alpaca.js - LLaMA engine → Local model files: writes models
llama.js - Alpaca engine → Local model files: writes models
alpaca.js - LLaMA engine → Dalai core: uses process runner
llama.js - Alpaca engine → Dalai core: uses process runner
alpaca.js - Browser user → Web server: opens UI
- Web server → Dalai core: configures API
bin/web/index.js - Web server → Web UI: renders page
bin/web/index.js - Web server → Prompt files: reads prompts
bin/web/index.js - Dalai core → Model executable: executes inference
index.js - Dalai core → Socket.io client: connects remotely
index.js - Torrent downloader → Local model files: downloads files
torrent.js