openproject-llm-stack

by OpenProject

Helm chartv1.0.0App 1.0.0GPL-3.0-onlyVerified publisher

A Helm chart for running the LLM stack for Open Project via Kubernetes

About this chart

LLM Stack

A helm chart for a self-hosted llm stack featuring:

  • Apisix as the AI gateway
    • running in api-based standalone mode (allowing only full config updates via api)
    • having a config seeder job that pushes the route and consumer configs initially using a headless service for pod discovery
  • An optional VLLM deployment for hosting an LLM in the cluster
  • Optional prometheus and grafana components for local development
  • values.yaml files and basic request scripts for local development in examples/ and bin/

Local Development

Minimum requirements for local vllm

  • 48gb RAM (64gb would be better)

Creating the cluster

k3d cluster create llm-stack-dev --port "80:80@loadbalancer"
kubectl create namespace llm-stack

Creating the Secrets

For the apisix initial config:

kubectl create secret generic llm-stack-apisix-initial-config-secret --from-literal=provider_api_key='abc' --from-literal=consumers='[{"name": "consumerA", "key": "sk-client-v1-abcdef123456"}]' -n llm-stack
  • provider_api_key is the key of the provider you are forwarding the requests to, e.g. scaleway, can be anything when using vllm
  • consumers is a stringified json array of consumers

For the apisix admin API:

kubectl create secret generic llm-stack-apisix-admin-secret --from-literal=admin='abc' --from-literal=viewer='def' -n llm-stack
  • admin is the admin key for editing
  • viewer is the admin key for viewing only

Installing the chart

With cpu-based VLLM and a tiny model enabled

helm install dev-release . -f examples/local-vllm-cpu.yaml -n llm-stack

Wait for the vllm liveness probe to start (~4 min) and make a test request:

bash bin/test-request-local-vllm.sh

Using scaleway instead of vllm

Adjust the scaleway project id in the apisixInitialConfig.base_url in examples/scaleway.yaml with your own credentials.

helm install dev-release . -f examples/scaleway.yaml -n llm-stack
bash bin/test-request-scaleway.sh

Observability

Grafana

Log into grafana at http://grafana.localhost using the default credentials (username: admin, password: admin)

Useful queries:

Successful requests for apisix grouped by consumer at 1 min interval:

sum(increase(apisix_http_status{code=~"[2].."}[1m])) by (consumer)

Failing requests for apisix grouped by consumer at 1 min interval:

sum(increase(apisix_http_status{code=~"[45].."}[1m])) by (consumer)

Deploy openproject-llm-stack with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has openproject-llm-stack on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartopenproject-llm-stack is pinned at v1.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply