Setup
Install
Install Docker with Compose and GNU Make. For CUDA services, configure an NVIDIA driver and the NVIDIA Container Toolkit.
git clone https://github.com/psyb0t/aigate.git
cd aigate
make bootstrap
Configure
make bootstrap creates a gitignored .env from the example. Replace the example AIGATE_TOKEN before starting the stack. LITELLM_MASTER_KEY defaults to that token. To use a separate bearer key for LiteLLM, set it explicitly.
Enable each optional component with its flag in .env. For example, GROQ=1 enables Groq with its API key, OLLAMA=1 enables local text models, and IMAGIES=1 or IMAGIES_CUDA=1 enables local image generation. Keys alone do not enable providers. See providers and the service index for the available options.
For Compose changes beyond the variables in .env, put the relevant service keys in docker-compose.override.yml. The Makefile loads this local override after the shipped files.
Check resource limits
make limits
This checks the enabled services against available memory and writes CPU caps to the gitignored .env.limits when needed. Run it again after changing profiles or moving to another host. Adjust service memory limits in .env if a model needs more memory. See resource management for how LiteLLM schedules competing models.
Start
make run-bg
curl --fail-with-body http://localhost:4000/health/liveliness
Use make run to run in the foreground or make logs to follow logs. The gateway is on port 4000. Optional model services may need to download weights on their first start. See using the gateway for the first request.
Upgrade the Imagies integration
Before switching to the renamed services, stop the old CPU or CUDA service from the previous checkout. Save your current .env and local Compose override so you can restore them if you roll back.
| Update | New value |
|---|---|
SDCPP=1 | IMAGIES=1 |
SDCPP_CUDA=1 | IMAGIES_CUDA=1 |
Other SDCPP_* settings | Corresponding IMAGIES_* settings |
DATA_DIR_SDCPP | DATA_DIR_IMAGIES |
Compose profiles and service names sdcpp, sdcpp-cuda | imagies, imagies-cuda |
LiteLLM aliases starting with local-sdcpp- | Aliases starting with local-imagies- |
Apply the new names to any local Compose overrides or client config. Keep the same model files by setting DATA_DIR_IMAGIES to the directory you already use. If the files are already in .data/imagies, the default still works. Start the new profile with make run-bg and use the new model IDs on POST /v1/images/generations. To roll back, return to the previous checkout and restore the saved settings. Both revisions can use the same weights directory.