Before You Start
Choose one path. The fresh install is the supported default. The existing-LiteLLM path is for teams that already operate LiteLLM and want to add Huawei MaaS models and the simpler UI.
Prerequisites
- Docker and Docker Compose
- A Huawei Cloud MaaS API key
- curl for downloading the Compose files
- A stable LITELLM_SALT_KEY before adding keys or models
What the full stack starts
- LiteLLM API on localhost:4000
- Simplified Huawei LiteLLM UI on localhost:3002
- Postgres for LiteLLM state
- Catalog sync and Huawei model seed jobs
1. Fresh Install
This path starts everything the project needs. Use it unless you already have a production LiteLLM instance.
Download the LiteLLM v1.112.1 setup
curl -fLO https://litellm.hwctools.site/downloads/litellm-huawei-v1.112.1.tar.gz
tar -xzf litellm-huawei-v1.112.1.tar.gz
cd litellm-huawei
The archive contains the Compose stack, the Huawei callback, and the dashboard source.
Set the credentials
umask 077
cat > .env <<EOF
HOST_BIND=127.0.0.1
LITELLM_MASTER_KEY=sk-$(openssl rand -hex 24)
LITELLM_SALT_KEY=sk-$(openssl rand -hex 24)
POSTGRES_PASSWORD=$(openssl rand -hex 24)
EOF
read -rs -p 'Huawei MaaS API key: ' maas_key
printf '\n'
printf 'HUAWEI_MAAS_API_KEY=%s\n' "$maas_key" >> .env
unset maas_key
./scripts/set-admin-password.sh --prepare
Run these commands in Bash with OpenSSL and Python 3 installed. Choose a long, unique dashboard password when prompted.
Start the stack
docker compose up -d --build
Compose builds the proxy from the pinned LiteLLM v1.112.1 image. Model seeding starts after the proxy becomes healthy.
2. Verify the Stack
Run these checks after docker compose up -d --build.
docker compose ps
curl -fsS http://localhost:4000/health/readiness
curl -fsS http://localhost:3002/health
export LITELLM_MASTER_KEY="$(sed -n 's/^LITELLM_MASTER_KEY=//p' .env)"
curl -fsS -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
http://localhost:4000/v1/models
curl -fsS http://localhost:4000/v1/chat/completions \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"messages": [{"role": "user", "content": "Reply with OK only."}],
"max_tokens": 8
}'
If the catalog changes, use a model ID returned by the model listing.
3. Use the Huawei LiteLLM UI
Open http://localhost:3002 after the stack is running.
Create, edit, clone, disable, and delete API keys. Configure model access, budgets, token quotas, rate limits, access schedules, and prompt policies.
Create teams with the same controls as keys. Team settings are applied to keys assigned to that team.
Use the stats pages to inspect spend by model, key, and team. Use the test page to send chat requests through a selected key.
4. Existing LiteLLM
Follow this path if you already have LiteLLM and Postgres running, and you want to add Huawei MaaS models and the Huawei LiteLLM UI.
Build the Huawei images from the source archive
docker compose build litellm maas-ui
docker compose run --rm --no-deps config-sync
Back up your database and environment before an in-place upgrade. Keep the same master key and salt, and let LiteLLM apply its database migrations.
Load the Huawei callback in LiteLLM
litellm_settings:
callbacks: custom_callbacks.proxy_handler_instance
drop_params: true
turn_off_message_logging: true
Mount the generated directory at /app/generated and set HUAWEI_MAAS_CATALOG_PATH=/app/generated/huawei_catalog.json. Place your LiteLLM config in that directory alongside the generated callback, or package the callback and its Python module with your existing config.
Connect the model seed job and dashboard
In the Compose file, set LITELLM_BASE_URL under environment for the seed job and dashboard to an address reachable from their containers. Use the existing proxy's LITELLM_MASTER_KEY, set the Huawei MaaS API key for the seed job, and set UI_DATABASE_URL to the proxy database. Configure an independent UI_SESSION_SECRET for the dashboard.
docker compose run --rm --no-deps model-seed
docker compose up -d --no-deps maas-ui
Troubleshooting
Common checks when the setup does not behave as expected.
Check the config-sync and model-seed logs. The seed job reads generated/model_seed.json.
Confirm HUAWEI_MAAS_API_KEY is set in the LiteLLM container and that the key is valid for Huawei MaaS.
LITELLM_SALT_KEY encrypts stored credentials. Changing it can break existing keys and model credentials.
Production Notes
Set strong secrets, keep the salt key stable, back up Postgres, and test tiered pricing after LiteLLM upgrades with prompts that cross 32K tokens.