How rasidi3112/pondok-ai works
pondok-ai is a CLI for configuring and operating a private, local AI stack, plus an OpenAI-compatible API gateway included in the standard/full presets. The main workflow is initialize a preset using hardware checks, generate configuration and Compose files, start and monitor Docker services, then manage models or share Open WebUI on a LAN. README capabilities also include diagnostics, lifecycle operations, updates, and integrity-checked backup/restore. Gateway route internals and several command implementations were not excerpted; those branches are documented at subsystem level, with links omitted where call ownership was not visible.
Main entry points: program.ts CLI commands · init.ts Initialize stack · app.ts Gateway server · client.ts Docker control
Components 26
CLI and operations
- CLI commands
src/cli/program.ts - Initialize stack
src/commands/init.ts - Lifecycle and status
src/commands/up.ts - Diagnostics
src/commands/doctor.ts - Model management
src/commands/model.ts - LAN sharing
src/commands/share.ts - Backup and restore
src/commands/backup.ts - Stack updates
src/commands/update.ts
Configuration and hardware
- Hardware detection
src/system/detect.ts - Model recommendations
src/system/recommendations.ts - Config and credentials
src/config/manager.ts - Preset definitions
src/config/defaults.ts
Stack runtime
- Compose generation
src/docker/compose.ts - Docker control
src/docker/client.ts - Service health
src/docker/health.ts - Native Ollama support
src/system/ollama-native.ts - Local AI services
- Open WebUI
- Process execution
src/utils/exec.ts
API gateway
- Gateway server
api/src/app.ts - Chat endpoint
api/src/routes/chat.ts - Embeddings endpoint
api/src/routes/embeddings.ts - Models endpoint
api/src/routes/models.ts - Ollama upstream
api/src/upstream.ts
Other components
- Operator
- OpenAI-compatible clients
Connections 37
- Operator → CLI commands: runs
src/cli/program.ts - CLI commands → Initialize stack: registers
src/cli/program.ts - CLI commands → Lifecycle and status: registers
src/cli/program.ts - CLI commands → Diagnostics: registers
src/cli/program.ts - CLI commands → Model management: registers
src/cli/program.ts - CLI commands → LAN sharing: registers
src/cli/program.ts - CLI commands → Backup and restore: registers
src/cli/program.ts - CLI commands → Stack updates: registers
src/cli/program.ts - Initialize stack → Hardware detection: detects
src/commands/init.ts - Initialize stack → Config and credentials: configures
src/commands/init.ts - Initialize stack → Preset definitions: uses
src/commands/init.ts - Initialize stack → Compose generation: generates
src/commands/init.ts - Initialize stack → Local AI services: prepares
README.md - Lifecycle and status → Docker control: controls
README.md - Lifecycle and status → Service health: checks health
README.md - Diagnostics → Hardware detection: checks system
README.md - Model management → Model recommendations: requests advice
src/commands/model.ts - Model management → Docker control: manages models
src/commands/model.ts - Model recommendations → Hardware detection: uses detection
src/system/recommendations.ts - LAN sharing → Config and credentials: loads config
src/commands/share.ts - LAN sharing → Docker control: checks stack
src/commands/share.ts - LAN sharing → Open WebUI: enables access
README.md - Backup and restore → Config and credentials: backs up config
src/commands/backup.ts - Backup and restore → Process execution: archives volumes
src/commands/backup.ts - Stack updates → Docker control: updates services
src/commands/update.ts - Compose generation → Preset definitions: uses defaults
src/docker/compose.ts - Compose generation → Native Ollama support: resolves runtime
src/docker/compose.ts - Docker control → Process execution: runs commands
src/docker/client.ts - Local AI services → Open WebUI: includes UI
README.md - Local AI services → Gateway server: includes gateway
README.md - OpenAI-compatible clients → Gateway server: calls API
README.md - Gateway server → Chat endpoint: routes requests
api/src/app.ts - Gateway server → Embeddings endpoint: routes requests
api/src/app.ts - Gateway server → Models endpoint: routes requests
api/src/app.ts - Chat endpoint → Ollama upstream: forwards inference
api/src/routes/chat.ts - Embeddings endpoint → Ollama upstream: forwards embeddings
api/src/routes/embeddings.ts - Models endpoint → Ollama upstream: queries models
api/src/routes/models.ts