text-generation-inference

by Substratus

Helm chartv0.1.1App 1.1.0Verified publisher

A Helm chart for deploying HuggingFace text-generation-inference. Text Generation Inference (TGI) is a toolkit for deploying and serving Large Language Models (LLMs). TGI enables high-performance text generation for the most popular open-source LLMs.

About this chart

text-generation-inference Helm Chart

A Helm chart for deploying HuggingFace text-generation-inference. Text Generation Inference (TGI) is a toolkit for deploying and serving Large Language Models (LLMs). TGI enables high-performance text generation for the most popular open-source LLMs.

Usage

Basic usage:

helm repo add substratusai https://substratusai.github.io/helm
helm install mistral-7b-instruct substratusai/text-generation-inference
# Note by default the resource limit is set to 1 GPU
helm install mistral-7b-instruct substratusai/text-generation-inference \
  --set model=mistralai/Mistral-7B-Instruct-v0.1

Mistral 7B Instruct on GCP with 1 x L4 GPU

Example for running Mistral 7b Instruct on GCP with L4 GPUs:

Create a file named values.yaml with following content:

model: mistralai/Mistral-7B-Instruct-v0.1
resources:
  limits:
    nvidia.com/gpu: 1
nodeSelector:
  cloud.google.com/gke-accelerator: nvidia-l4
helm install mistral-7b-instruct substratusai/text-generation-inference \
    -f values.yaml

Values

Take a look at the default values.yaml:

replicaCount: 1
# Change this if you want to serve another model
model: Open-Orca/Mistral-7B-OpenOrca

# Override the resources if you need more
resources:
  requests:
    cpu: 500m
    memory: "512Mi"
  limits:
    nvidia.com/gpu: 1

quantize: ""
# quantize: "bitsandbytes-nf4"

# Override env variables
env: {}
port: 8080

# Add nodeSelectors to target specific GPU types
nodeSelector: {}
#  E.g. for GCP L4 cloud.google.com/gke-accelerator: nvidia-l4

image:
  repository: ghcr.io/huggingface/text-generation-inference
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

podAnnotations: {}

podSecurityContext: {}

securityContext: {}

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: false
  className: ""
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: chart-example.local
      paths:
        - path: /
          pathType: ImplementationSpecific
  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

tolerations: []

affinity: {}

Deploy text-generation-inference with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has text-generation-inference 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 charttext-generation-inference is pinned at v0.1.1 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