mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-13 15:22:38 +00:00
tgi docker compose
This commit is contained in:
parent
a2b87ed0cb
commit
0325a767b6
2 changed files with 114 additions and 0 deletions
55
scripts/docker/tgi/compose.yaml
Normal file
55
scripts/docker/tgi/compose.yaml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
services:
|
||||
text-generation-inference:
|
||||
image: ghcr.io/huggingface/text-generation-inference:latest
|
||||
network_mode: "host"
|
||||
volumes:
|
||||
- $HOME/.cache/huggingface:/data
|
||||
ports:
|
||||
- "5009:5009"
|
||||
devices:
|
||||
- nvidia.com/gpu=all
|
||||
environment:
|
||||
- CUDA_VISIBLE_DEVICES=0
|
||||
- HF_HOME=/data
|
||||
- HF_DATASETS_CACHE=/data
|
||||
- HF_MODULES_CACHE=/data
|
||||
- HF_HUB_CACHE=/data
|
||||
command: ["--dtype", "bfloat16", "--usage-stats", "on", "--sharded", "false", "--model-id", "meta-llama/Llama-3.1-8B-Instruct", "--port", "5009", "--cuda-memory-fraction", "0.3"]
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:5009/health"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
# that's the closest analogue to --gpus; provide
|
||||
# an integer amount of devices or 'all'
|
||||
count: 1
|
||||
# Devices are reserved using a list of capabilities, making
|
||||
# capabilities the only required field. A device MUST
|
||||
# satisfy all the requested capabilities for a successful
|
||||
# reservation.
|
||||
capabilities: [gpu]
|
||||
runtime: nvidia
|
||||
llamastack-local-cpu:
|
||||
depends_on:
|
||||
text-generation-inference:
|
||||
condition: service_healthy
|
||||
restart: on-failure
|
||||
image: llamastack-local-cpu
|
||||
network_mode: "host"
|
||||
volumes:
|
||||
- ~/.llama:/root/.llama
|
||||
# Link to TGI run.yaml file
|
||||
- ./tgi-run.yaml:/root/llamastack-run-tgi.yaml
|
||||
ports:
|
||||
- "5000:5000"
|
||||
command: ["--yaml_config", "/root/llamastack-run-tgi.yaml"]
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:5009/health"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue