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

Add sglang dockerfile #307

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,15 @@ If you're having trouble with dependencies, and you have [nvidia-container-toolk
you can start your environment like this:

```shell
sudo docker run --gpus all -it --ipc=host --name functionary -v ${PWD}/functionary_workspace:/workspace -p 8000:8000 nvcr.io/nvidia/pytorch:23.10-py3
cd <ROOT>

# vLLM
sudo docker build -t functionary-vllm -f dockerfiles/Dockerfile.vllm .
sudo docker run --runtime nvidia --gpus all -p 8000:8000 functionary-vllm

# SGLang
sudo docker build -t functionary-sglang -f dockerfiles/Dockerfile.sgl .
sudo docker run --runtime nvidia --gpus all -p 8000:8000 functionary-sglang
```

### OpenAI Compatible Usage
Expand Down
25 changes: 25 additions & 0 deletions dockerfiles/Dockerfile.sgl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use SGLang's image as the base
FROM lmsysorg/sglang:v0.3.4.post1-cu124

# Define a build argument for the working directory, defaulting to /workspace
ARG WORKDIR_ARG=/workspace

# Set the working directory
WORKDIR ${WORKDIR_ARG}

# Install necessary build dependencies for sentencepiece
RUN apt-get update && apt-get install -y \
pkg-config \
cmake \
build-essential

# Copy functionary code and requirements into workspace
COPY . .

# Install additional Python dependencies
RUN --mount=type=cache,target=/root/.cache/pip \
python3 -m pip install .[sglang]

# Override the SGLang entrypoint with the functionary server
ENTRYPOINT ["python3", "server_sglang.py", "--model-path", "meetkai/functionary-small-v3.2", "--host", "0.0.0.0", "--port", "8000", "--context-length", "8192"]
CMD []
Loading