This document describes how LocalAIStack executes software modules.
It explains the rationale and boundaries between container-based and native execution modes.
Runtime components execute instructions provided by the Control Layer.
They do not make decisions.
Isolation is preferred by default. Native execution is reserved for performance-critical paths.
LocalAIStack implements a runtime manager with two execution backends:
- Container runtime: Docker or Podman CLI integration.
- Native runtime: Direct process execution on the host.
The manager tracks process state, captures logs, and publishes health status for every running module.
Used for:
- Services
- Applications
- Developer tools
- Non-performance-critical components
Advantages
- Isolation
- Reproducibility
- Easier upgrades and rollbacks
Used for:
- llama.cpp
- vLLM (high-throughput paths)
- CUDA-sensitive workloads
Advantages
- Maximum performance
- Direct hardware access
Execution mode is determined by:
- Module manifest declaration (
runtime.modes+ optionalruntime.preferred) - Policy constraints (allowed runtimes)
- Local runtime configuration (
runtime.default_mode,runtime.docker_enabled,runtime.native_enabled) - User preference (optional override)
If the preferred mode is unavailable, the runtime manager falls back to the default mode or the first available mode.
- Process lifecycle
- Resource allocation
- Log capture
- Health reporting
The runtime manager supports:
- Start/Stop: launch and terminate module processes or containers.
- Monitoring: track running state and exit status.
- Log capture: stream stdout/stderr to per-module log files under
runtime.log_dir.
Container logs are collected via docker logs/podman logs.
Native processes stream logs directly from stdout/stderr.
Health status is reported as:
- healthy: process/container is running and optional checks succeed.
- unhealthy: process/container has exited or health checks fail.
- unknown: no health signal yet.
For containers with health checks configured in the image, the runtime manager reads the container health status. For native processes, the manager reports healthy while the process is running or executes an optional health command.
- No dependency resolution
- No policy evaluation
- No UI logic
- GPU access is explicit
- Memory limits are enforced where possible
- Overcommitment is avoided by policy
Runtime failures result in:
- Explicit error states
- Preserved logs
- No silent retries unless configured
- Containers run with minimal privileges
- Native execution is limited to trusted modules
- No implicit network exposure
Potential extensions:
- Alternative container backends
- Hybrid execution modes
- Multi-node runtimes (optional)
The runtime model balances:
- Safety and isolation
- Performance and control
- Predictability and flexibility
LocalAIStack treats execution as infrastructure, not automation.
For smart model run tuning and operational flags, see: