Skip to content

Commit

Permalink
[Examples] Add vLLM container example (#3694)
Browse files Browse the repository at this point in the history
* add docker example

* fix link
  • Loading branch information
romilbhardwaj committed Jun 27, 2024
1 parent bd383e9 commit a51b507
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llm/vllm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ sky launch -c vllm-llama2 serve-openai-api.yaml --env HF_TOKEN=YOUR_HUGGING_FACE
```bash
sky launch -c vllm-llama2 serve-openai-api.yaml --gpus V100:1 --env HF_TOKEN=YOUR_HUGGING_FACE_API_TOKEN
```
**Tip**: You can also use the vLLM docker container for faster setup. Refer to [serve-openai-api-docker.yaml](https://github.com/skypilot-org/skypilot/tree/master/llm/vllm/serve-openai-api-docker.yaml) for more.

2. Check the IP for the cluster with:
```
IP=$(sky status --ip vllm-llama2)
Expand Down
20 changes: 20 additions & 0 deletions llm/vllm/serve-openai-api-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
envs:
MODEL_NAME: meta-llama/Llama-2-7b-chat-hf
HF_TOKEN: # TODO: Fill with your own huggingface token, or use --env to pass.

resources:
image_id: docker:vllm/vllm-openai:latest
accelerators: {L4:1, A10G:1, A10:1, A100:1, A100-80GB:1}
ports:
- 8000

setup: |
conda deactivate
python3 -c "import huggingface_hub; huggingface_hub.login('${HF_TOKEN}')"
run: |
conda deactivate
echo 'Starting vllm openai api server...'
python -m vllm.entrypoints.openai.api_server \
--model $MODEL_NAME --tokenizer hf-internal-testing/llama-tokenizer \
--host 0.0.0.0

0 comments on commit a51b507

Please sign in to comment.