Quickstart
Install amicu, deploy a model on your machine or on a GPU provider, send a request, and tear it down.
1. Choose where to run
Two equal paths. Pick one; steps 2 and 3 are shared.
| Path A: on this machine | Path B: on a GPU provider | |
|---|---|---|
| Where | macOS, Linux or Windows; launchd, systemd or Task Scheduler user service | A remote GPU provider you have an account with |
| Runtime | llama.cpp or vLLM | llama.cpp or vLLM |
| Endpoint | Loopback, api_key optional | Public, api_key required |
| Status | Supported | Today apply supports Modal and RunPod; Hetzner, OVHcloud, Scaleway and SSH are in preview, and AWS, Azure, GCP and Nebius are planned |
See Providers for every provider and its status.
2. Install
amicu runs on macOS and Linux (arm64 and x86_64) and on Windows (x86_64).
curl -LsSf https://amicu.dev/install.sh | shThe installer downloads a prebuilt binary and puts amicu in ~/.local/bin. It edits your shell profile, so open a new shell, then check it. On Windows, use the PowerShell installer instead:
powershell -ExecutionPolicy Bypass -c "irm https://amicu.dev/install.ps1 | iex"Then open a new terminal and check it:
amicu --version
amicu --helpWith Homebrew:
brew install andypalmi/tap/amicuTo build from source instead, you need Rust 1.97 or newer:
cargo install --locked --git https://github.com/andypalmi/amicu amicu-cli # installs into ~/.cargo/binOr clone and build:
git clone https://github.com/andypalmi/amicu.git
cd amicu
cargo build --release -p amicu-cli
export PATH="$PWD/target/release:$PATH"
amicu --help3. Initialize a project
Create an empty directory and run init in it.
mkdir my-stack && cd my-stack
amicu init --exampleinit creates amicu.hcl (only a comment header, no resources), variables.amicu.hcl (a placeholder), and .amicu/ (project config and state). It never overwrites existing files.
For a working starter, add --example. A bare --example picks the one for this machine: macOS gets mac, Linux with nvidia-smi gets linux-cuda, and any other Linux gets linux-cpu. Windows is detected the same way as Linux: nvidia-smi on PATH gets linux-cuda, otherwise linux-cpu (plain llama.cpp starters despite the names). Its hardware profile is the detected machine, and it picks a Qwen3.5 GGUF model and a context length (up to the native 262144) that fit its memory, with output capped at 65536 tokens. It replaces the header-only amicu.hcl while that is unchanged, and never overwrites a file you edited. To choose yourself:
amicu init --example # detect this machine
amicu init --example mac # Apple Silicon, llama.cpp with Metal
amicu init --example linux-cuda # NVIDIA GPU, llama.cpp with all layers on the GPU
amicu init --example linux-cpu # no GPU, llama.cpp on the CPU
amicu init --example modal # Modal serverless GPU (Path B)A local example must match the machine it runs on. See Init examples. The same files are in the repository under examples/. To see what fits before you pick, run amicu catalog fits.
Path A: on this machine
Requirements:
llama-serverfrom llama.cpp on yourPATH(on macOS,brew install llama.cpp).applyresolves it fromPATHto an absolute path and fails withllama-server not found on PATH; install with ...if it is missing.amicu doctorreports whether it is found.- A GGUF file for the model. Amicu does not download it; you do, once.
The starter config
amicu init --example writes an amicu.hcl like this one. On a Mac with 48 GiB of memory it serves unsloth/Qwen3.5-27B-GGUF (Qwen3.5-27B-Q4_K_M.gguf, about 17 GB) with llama.cpp. Smaller machines get a smaller model, so the model id, file name and context length below depend on your machine:
resource "model" "qwen35_27b" {
source {
registry = "hugging_face"
reference = "unsloth/Qwen3.5-27B-GGUF"
}
architecture = "qwen35"
modalities = ["text"]
artifact {
format = "gguf"
quantization = "q4_k_m"
}
context_length = 262144
n_layers = 64
n_kv_layers = 16
n_kv_heads = 4
head_dim = 256
variant {
quantization = "q4_k_m"
file = "Qwen3.5-27B-Q4_K_M.gguf"
size = "16740812704B"
}
}
resource "hardware_profile" "local_dev" {
provider = "local_apple"
accelerator {
kind = "apple_silicon"
model = "m4_pro"
count = 1
memory = "48GiB"
}
memory = "48GiB"
}
resource "deployment" "qwen35_27b_local" {
model = model.qwen35_27b.id
hardware = hardware_profile.local_dev.id
runtime = "llama_cpp"
llama_cpp {
context_length = 262144
port = 8000
n_gpu_layers = -1
extra_args = ["--n-predict", "65536"]
}
}variant.size is an integer number of bytes; "16740812704B" and "16740812704" mean the same. The hardware_profile is what init detected, and the fit check uses it. Change it only if you plan for another machine; see Hardware profile. Lower context_length if memory is tight.
Get the GGUF
If init picked a smaller model for your machine, use the model id and file name from your amicu.hcl in place of qwen35_27b and Qwen3.5-27B-Q4_K_M.gguf below. The model resource id decides where the file goes: models/<model id>/<variant.file> relative to the project directory. Here that is models/qwen35_27b/Qwen3.5-27B-Q4_K_M.gguf. You can instead set variant.file to an absolute path.
mkdir -p models/qwen35_27b
curl -L -o models/qwen35_27b/Qwen3.5-27B-Q4_K_M.gguf \
https://huggingface.co/unsloth/Qwen3.5-27B-GGUF/resolve/main/Qwen3.5-27B-Q4_K_M.ggufFor gated or private repos, add -H "Authorization: Bearer $HF_TOKEN".
Validate, plan, apply
amicu doctor
amicu validate
amicu plan
amicu applydoctor and plan compare a local hardware profile with this machine. If the profile declares more memory than the machine has, they print the warning AMICU-MEM-003. It is only a warning, because plan may run on another machine than the one you deploy to, such as CI. Fix the profile, or ignore it when that is the case.
plan prints the exact llama-server command, with the model path relative to the project, models/qwen35_27b/Qwen3.5-27B-Q4_K_M.gguf. The service runs with the absolute path. apply shows the plan, asks for approval, installs a user service (launchd on macOS, systemd on Linux, a per-user Task Scheduler task that starts at logon on Windows), starts it, and waits up to 15 minutes for /health to answer. If the service exits during startup, apply fails within seconds. On any failure it stops the service and the error gives the log location. See This machine.
Send a request
The deployment has no api_key, so no header is needed; the endpoint is bound to 127.0.0.1.
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "unsloth/Qwen3.5-27B-GGUF", "messages": [{"role": "user", "content": "Hello"}]}'If the request fails, check that the service is running and read its log: on macOS ~/Library/Logs/amicu/<label>.out.log and <label>.err.log, on Linux journalctl --user --unit=<label>. The label is io.amicu.llama.<project_id>.qwen35_27b_local, where project_id is in .amicu/state/state.json. A missing or wrong GGUF path is the usual cause; confirm the file exists at models/qwen35_27b/ in the project directory.
To require a key even locally, add api_key = secret("LOCAL_API_KEY") to the deployment and export LOCAL_API_KEY before apply, then send Authorization: Bearer $LOCAL_API_KEY.
Path B: on a GPU provider
The steps are the same for any provider:
- Pick a provider from the registry and create an account there.
- Export its credentials in your shell. Never write them into HCL.
- Set
provider(and optionallyregion) on thehardware_profile. - Give the deployment an endpoint key:
api_key = secret("CHAT_API_KEY"), withCHAT_API_KEYexported. Every off-machine endpoint needs one. - Run
amicu validate,amicu plan,amicu apply.
plan shows api_key: ****** and never reads the key value (it only checks that the variable is set). apply starts the deployment and then checks that the endpoint rejects anonymous requests and accepts your key. The first deploy downloads the weights and can take several minutes.
Today, apply supports Modal and RunPod as remote GPU providers. Hetzner, OVHcloud, Scaleway and SSH are in preview (adapter built, not wired into apply), and AWS, Azure, GCP and Nebius are planned. Selecting one of those fails at apply with a clear error before anything starts. Each provider page has its own setup and troubleshooting.
Requirements: a Modal account and four token values. MODAL_TOKEN_ID and MODAL_TOKEN_SECRET authenticate the control plane. MODAL_PROXY_TOKEN_ID and MODAL_PROXY_TOKEN_SECRET are a Proxy Auth Token (Modal dashboard, Settings, Proxy Auth Tokens). See Modal.
export MODAL_TOKEN_ID=...
export MODAL_TOKEN_SECRET=...
export MODAL_PROXY_TOKEN_ID=...
export MODAL_PROXY_TOKEN_SECRET=...
export CHAT_API_KEY=$(openssl rand -hex 32)
amicu modal auth-checkReplace the contents of amicu.hcl with:
resource "model" "qwen" {
source {
registry = "hugging_face"
reference = "RedHatAI/Qwen3.5-9B-FP8-dynamic"
}
architecture = "qwen3_5"
modalities = ["text"]
artifact {
format = "safetensors"
quantization = "fp8"
}
context_length = 262144
n_layers = 32
n_kv_layers = 8
n_kv_heads = 4
head_dim = 256
}
resource "hardware_profile" "gpu_2xl4" {
provider = "modal"
region = "eu-west"
accelerator {
kind = "gpu"
model = "l4"
count = 2
memory = "24GiB"
}
memory = "64GiB"
}
resource "deployment" "chat" {
model = model.qwen.id
hardware = hardware_profile.gpu_2xl4.id
runtime = "vllm"
api_key = secret("CHAT_API_KEY")
vllm {
context_length = 262144
port = 8000
tensor_parallel_size = 2
env {
NCCL_P2P_DISABLE = "1"
}
}
}When apply finishes it prints the endpoint URL and a ready-to-copy curl command. Modal needs both layers of credentials:
curl "$URL/v1/chat/completions" \
-H "Authorization: Bearer $CHAT_API_KEY" \
-H "Modal-Key: $MODAL_PROXY_TOKEN_ID" \
-H "Modal-Secret: $MODAL_PROXY_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{"model": "RedHatAI/Qwen3.5-9B-FP8-dynamic", "messages": [{"role": "user", "content": "Hello"}]}'A 503 while the container cold-starts is normal.
validate and plan print the warning AMICU-CAP-010 for this model, because it does not declare n_layers, n_kv_heads, and head_dim. It is expected: the fit check then covers weights only. Declare the shape (or kv_bytes_per_token) on the model to silence it.
4. Tear down
amicu destroydestroy lists every deployment recorded in state, asks Destroy these deployments? [y/N], and then stops each one and removes it from state. To tear down only some of them, pass --target <name> (repeatable). Use --auto-approve (alias --yes) to skip the prompt.
A deployment leaves state only after its stop is confirmed. If a stop fails, the command exits with an error, the deployment stays in state, and you can re-run amicu destroy. On macOS and Linux, destroy also deletes the service file, which holds the endpoint API key. On Windows it deletes the scheduled task and its definition, launcher, pid and environment files (the environment file holds the key). Add --purge to also delete the host log files of the destroyed deployments. Modal cache volumes are never deleted. See Plan, apply and state.
You can also delete a deployment from your HCL and run amicu apply; the plan then shows a destroy action for it.
Some providers also have a direct stop command; see the provider page (for example Modal).
Next
Last updated