Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Examples] Fix Vicuna serve example and add OpenAI Example for Vicuna #2791

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions llm/vicuna/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ sky launch -c vicuna-serve-v100 -s serve.yaml --gpus V100
sky launch -c vicuna-serve -s serve.yaml --env MODEL_SIZE=13
```

5. [Optional] Serve the OpenAI API Compatible Endpoint:
```bash
sky launch -c vicuna-openai-api -s serve-openai-api-endpoint.yaml
```


## Training Vicuna with SkyPilot
Currently, training requires GPUs with 80GB memory. See `sky show-gpus --all` for supported GPUs.
Expand Down
36 changes: 36 additions & 0 deletions llm/vicuna/serve-openai-api-endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
resources:
ports: 8080
accelerators: A100:1
disk_size: 1024
disk_tier: high

setup: |
conda activate chatbot
if [ $? -ne 0 ]; then
conda create -n chatbot python=3.9 -y
conda activate chatbot
fi

# Install dependencies
pip install "fschat[model_worker,webui]==0.2.24"
pip install protobuf

run: |
conda activate chatbot

echo 'Starting controller...'
python -u -m fastchat.serve.controller > ~/controller.log 2>&1 &
sleep 10
echo 'Starting model worker...'
python -u -m fastchat.serve.model_worker \
--model-path lmsys/vicuna-${MODEL_SIZE}b-v1.3 2>&1 \
| tee model_worker.log &

echo 'Waiting for model worker to start...'
while ! `cat model_worker.log | grep -q 'Uvicorn running on'`; do sleep 1; done

echo 'Starting openai api server...'
python -u -m fastchat.serve.openai_api_server --host 0.0.0.0 --port 8080 | tee ~/openai_api_server.log

envs:
MODEL_SIZE: 13
3 changes: 2 additions & 1 deletion llm/vicuna/serve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ setup: |
fi

# Install dependencies
pip install git+https://github.com/lm-sys/FastChat.git
pip install "fschat[model_worker,webui]==0.2.24"
pip install protobuf


run: |
Expand Down