This machine
Run llama.cpp or vLLM as a launchd, systemd or Task Scheduler user service, on macOS, Linux, Windows, Apple Silicon, or CPU.
- Status
- Supported
- Kind
- launchd or systemd service
- Provider id
local, local_apple, local_cpu, on_prem- Regions and residency
- Wherever the machine is
Use this provider
resource "hardware_profile" "dev_mac" {
provider = "local_apple"
accelerator {
kind = "apple_silicon"
model = "m4_pro"
count = 1
memory = "48GiB"
}
memory = "48GiB"
}Overview
Hardware profiles with provider set to local, local_apple, local_cpu, or on_prem run on the machine where you invoke amicu. The four ids differ in intent, not in how apply runs them:
| Provider id | Use it for |
|---|---|
local | A generic local machine. |
local_apple | Apple Silicon, with accelerator.kind = "apple_silicon". |
local_cpu | CPU-only machines, with a cpu {} block. |
on_prem | A server you own, where you run amicu on the host itself. |
A profile with no provider also means the local host.
These ids are supported by apply, which runs the runtime on the host you invoke it from. Modal is tested end to end on real GPUs, and RunPod was tested live with vLLM on Serverless (eu region) and vLLM on pods (L4); the llama.cpp live test on RunPod is still pending; the local path is implemented for macOS (launchd), Linux (systemd) and Windows x86_64 (Task Scheduler), as described below. vLLM is Linux-only.
How it runs
apply renders the runtime's command line from your llama_cpp {} or vllm {} block, registers it as a per-user service, and waits up to 15 minutes for /health to answer. A service that exits during startup fails within seconds. On failure, apply stops the service and the error gives the log location.
| OS | Service manager | Details |
|---|---|---|
| macOS | launchd | A LaunchAgent plist in ~/Library/LaunchAgents/, loaded with launchctl. It has RunAtLoad, so the service starts again when you log in. Logs go to ~/Library/Logs/amicu/. |
| Windows | Task Scheduler | A per-user scheduled task with a logon trigger, so the service starts when you log in. It needs no administrator rights and is not a Windows Service. |
| Linux | systemd | A persistent --user unit at ~/.config/systemd/user/<label>.service, enabled and started with systemctl --user enable --now. It restarts on failure (Restart=on-failure). The secrets are in a 0600 environment file under ~/.local/state/amicu/env, not in the unit file. |
The service label is io.amicu.llama.<project_id>.<deployment id>, for both llama.cpp and vLLM deployments. project_id is stored in .amicu/state/state.json, so two projects never share a label. The server binds to 127.0.0.1 on the port you set. The host is not configurable.
On Linux, the unit comes back after a reboot, at your next login. To start it at boot without logging in, enable lingering for your user: sudo loginctl enable-linger $USER. Apply prints this hint when lingering is off. amicu never runs that command itself.
When you change a deployment, apply replaces the running service; it may wait up to 10 seconds for the old one to stop. If something else still answers /health on the port, apply fails with port N is already serving /health. When you remove a deployment from the configuration, apply stops and unloads its service.
Host check
A local profile that declares more memory than this machine has gets the warning AMICU-MEM-003 from amicu plan and amicu doctor. It is a warning, not an error, because plan may run on another machine than the target, such as CI. A declared figure is accepted up to the largest of 5% over the detected one, the detected one plus 256 MiB, and the detected one rounded to the nearest GiB, since Linux reports slightly less than the installed RAM. Accelerator memory is compared only when it was detected: unified memory on Apple Silicon, or VRAM from nvidia-smi on Linux. Remote providers are never compared.
Requirements
- llama.cpp runtime:
llama-serveronPATH.applyresolves it fromPATHto an absolute path and fails withllama-server not found on PATH; install with ...if it is missing. Runamicu doctorto confirm it is found. amicu does not check which build you have; use a CUDA build ofllama-serverfor GPU offload. - vLLM runtime:
vllmonPATH; if it is missing, apply fails withvllm not found on PATH; install withpip install vllm``. A native single-process vLLM run needs a supported GPU (NVIDIA CUDA, AMD ROCm, or Intel XPU). - Model file: for llama.cpp, a GGUF file that you download yourself; amicu does not download weights. Put it at
models/<model resource id>/<variant.file>relative to the project directory, or setvariant.fileto an absolute path.amicu planshows the path relative to the project,models/<model id>/<file>.applymakes it absolute when it starts the service. A relative file name must be a plain name: not empty, not.or.., and without/,\or NUL. See the Quickstart for a download command.
Full example
resource "model" "support_chat" {
source {
registry = "hugging_face"
reference = "unsloth/Qwen3.5-9B-GGUF"
}
architecture = "qwen35"
modalities = ["text"]
artifact {
format = "gguf"
quantization = "q4_k_m"
}
context_length = 8192
variant {
quantization = "q4_k_m"
file = "Qwen3.5-9B-Q4_K_M.gguf"
size = "5680522464B"
}
}
resource "hardware_profile" "dev_mac" {
provider = "local_apple"
accelerator {
kind = "apple_silicon"
model = "m4_pro"
count = 1
memory = "48GiB"
}
memory = "48GiB"
}
resource "deployment" "support_local" {
model = model.support_chat.id
hardware = hardware_profile.dev_mac.id
runtime = "llama_cpp"
api_key = secret("LOCAL_API_KEY")
llama_cpp {
context_length = 8192
port = 8000
n_gpu_layers = -1
}
}On Apple Silicon, n_gpu_layers = -1 offloads every layer to Metal. Lower it, or use 0 for CPU only, if memory is tight.
Endpoint key
A local deployment may omit api_key; its endpoint is loopback only. If you set it, apply reads the value from the environment variable of that name and passes it to the service as LLAMA_API_KEY (llama.cpp) or VLLM_API_KEY (vLLM) through a private file, never the command line. After start, amicu confirms anonymous requests are rejected. Without an api_key, the endpoint is loopback only and that check is skipped. See Secrets.
export LOCAL_API_KEY=$(openssl rand -hex 32)
amicu apply
curl http://127.0.0.1:8000/v1/models -H "Authorization: Bearer $LOCAL_API_KEY"Stopping by hand
If amicu cannot stop a service, apply prints the command to run:
- Linux:
systemctl --user disable --now <label>(a plainsystemctl --user stopleaves the unit enabled, so it starts again at next login) - macOS:
launchctl bootout gui/$(id -u)/<label>
After a stop by hand, run amicu destroy so that state and the service files are cleaned up. Until then, the next plan or apply reports the service as a drift: it is kept in state as pending and restarted by apply.
Configuration reference
| Argument | Type | Default | Required | Notes |
|---|---|---|---|---|
provider | string | none | yes | local, local_apple, local_cpu, or on_prem. |
region | string | none | no | Not used for placement. Residency checks cannot prove a region for local providers. |
accelerator.kind | string | none | no | gpu, apple_silicon, or cpu. |
accelerator.model, count, memory | string, number, size | none | yes (with accelerator) | Used by the fit check. |
cpu.model, cpu.cores | string, number | none | yes (with cpu) | For CPU-only machines. |
memory | size | none | yes | Host RAM, or unified memory on Apple Silicon. |
deployment api_key | secret(...) | none | no | Optional locally; the endpoint is loopback only. |
llama_cpp.port / vllm.port | number | none | yes | The server binds to 127.0.0.1 on this port. |
See hardware_profile and deployment for every field.
GPUs and regions
The accelerator is whatever the machine has; amicu does not provision it. llama.cpp offloads layers with n_gpu_layers (Metal on Apple Silicon, CUDA on NVIDIA per your llama-server build). n_gpu_layers = -1 offloads all layers to the GPU. A native single-process vLLM run needs a supported GPU (NVIDIA CUDA, AMD ROCm, or Intel XPU). There are no regions: the endpoint is on the machine, wherever it is.
For a gpu accelerator, the fit check counts the model weights against VRAM (accelerator.memory times count, minus a reserve per card). For llama.cpp, the check counts weights only unless the model declares n_layers, n_kv_heads, and head_dim. With those, it also estimates the KV cache from context_length, and the estimated peak (weights + KV cache + runtime overhead, about 10% of the weights) must fit in device memory. The 2 GiB reserve applies to the weights check only. vLLM also adds the KV cache and uses gpu_memory_utilization. The check does not read n_gpu_layers, so partial offload is not modelled: all weights are counted against VRAM whatever the value. A model that does not fit fails plan with AMICU-MEM-001. See Error codes.
Limits
- Loopback only:
127.0.0.1, not configurable. - On Linux the service is a persistent systemd user unit. It starts at your next login, or at boot once lingering is enabled.
- amicu does not download model weights.
- One service per deployment, labelled
io.amicu.llama.<project_id>.<deployment id>. Deployments from before the project-scoped labels keep the unscoped label until their nextapply, which stops the old job first.
Troubleshooting
Source
Supervisors: crates/amicu-cli/src/commands/apply.rs. Status of every provider: Providers.
Last updated