This document defines the module system used by LocalAIStack.
Modules are the fundamental units of installation, execution, and lifecycle management. Everything managed by LocalAIStack — languages, runtimes, frameworks, services, applications, and tools — is represented as a module.
Modules describe what they are and what they require, not how they are installed.
Imperative logic belongs to the runtime layer, not the module definition.
Each module:
- Declares its own dependencies
- Defines its hardware constraints
- Exposes explicit interfaces
- Can be installed, upgraded, or removed independently
Modules may declare requirements (e.g. VRAM, CUDA version), but they do not hardcode assumptions about specific GPUs or vendors.
LocalAIStack defines the following module categories:
| Category | Description |
|---|---|
language |
Programming language environments |
runtime |
AI inference engines and execution backends |
framework |
AI and ML frameworks |
service |
Infrastructure services |
application |
End-user AI applications |
tool |
Developer tools |
model |
Model metadata and storage descriptors |
Categories are informational and do not imply execution semantics.
Each module exists in one of the following states:
availableresolvedinstalledrunningstoppedfaileddeprecated
State transitions are managed exclusively by the Control Layer.
Allowed transitions:
| From → To | Notes |
|---|---|
available → resolved |
Dependencies are resolved |
resolved → installed |
Installation completed |
installed → running |
Runtime started |
installed → stopped |
Installed but idle |
running → stopped |
Runtime stopped |
stopped → running |
Runtime resumed |
* → failed |
Error during lifecycle |
* → deprecated |
Deprecated/removed from registry |
The control layer may also move a failed module back to resolved after remediation.
Each module is defined by a manifest file written in YAML.
Example:
name: llama.cpp
category: runtime
version: 0.2.15
description: High-performance local LLM inference engine
hardware:
gpu:
vram_min: 8GB
cpu:
cores_min: 4
dependencies:
system:
- cmake
runtime:
- cuda>=12.1
runtime:
modes:
- native
- container
interfaces:
provides:
- openai-compatible-api
integrity:
checksum: sha256:...name: string
category: string
version: string
description: string
license: string (optional)hardware:
cpu:
cores_min: integer
memory:
ram_min: string
gpu:
vram_min: string
multi_gpu: booleanIf requirements are not met, the module is not installable.
dependencies:
system:
- package-name
modules:
- module-name
- module-name@>=1.2.3
runtime:
- runtime-constraintDependencies are resolved before installation planning.
runtime:
modes:
- container
- native
preferred: nativeThe Control Layer decides the final execution mode.
interfaces:
provides:
- api
- service
consumes:
- databaseInterfaces are logical contracts, not network bindings.
integrity:
checksum: sha256:...
signature: <optional detached signature>If a checksum is provided, the registry validates it before accepting the manifest.
LocalAIStack publishes a machine-readable schema for validation at:
This schema is used by the registry validator to ensure manifests are complete and consistent.
The registry is the source of truth for available modules. It:
- Loads manifests from a registry directory
- Validates schema and integrity metadata
- Stores multiple versions per module
- Exposes a version-aware lookup API
Manifests can be grouped by category or vendor inside the registry directory, as long as each manifest file is discoverable.
Dependencies are resolved before installation planning.
- Each module may depend on other modules using optional version constraints.
- The resolver selects the newest compatible version available.
- If a dependency cannot be satisfied, resolution fails with a conflict error.
- Cycles are detected and rejected.
The resolver outputs a topologically sorted installation plan so dependencies are installed before dependents.
For LLM-assisted install planning details and runtime switches, see:
- Modules are versioned independently
- Compatibility is validated at resolution time
- Breaking changes must increment major versions
New modules can be added by:
- Adding a manifest file
- Registering it with the module registry
No core code modification is required.
- Modules do not embed secrets
- Modules do not perform installation logic
- Modules do not mutate global state directly
The module system ensures LocalAIStack remains:
- Extensible
- Predictable
- Hardware-aware
- Long-term maintainable