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

[Doc] Dockerfile instructions for optional dependencies and dev transformers #13699

Merged
merged 6 commits into from
Feb 22, 2025
Merged
Changes from 1 commit
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
Next Next commit
[Doc] Dockerfile instructions for optional dependencies and dev trans…
…formers

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
  • Loading branch information
DarkLight1337 committed Feb 22, 2025
commit 7c326da31722634fc2878a46d315f18411ff1702
30 changes: 30 additions & 0 deletions docs/source/deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,36 @@ container to access the host's shared memory. vLLM uses PyTorch, which uses shar
memory to share data between processes under the hood, particularly for tensor parallel inference.
:::

:::{note}
Optional dependencies are not included in order to avoid licensing issues (e.g. <gh-issue:8030>).

If you need those dependencies, create a custom Dockerfile on top of the base image
with an extra layer that installs them.

For example, to include the `audio` and `video` optional dependencies:

```Dockerfile
FROM vllm/vllm-openai:latest

RUN uv pip install --system vllm[audio,video]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will install public latest released vllm, right? what if people build their own docker on a custom commit, and then just want to install these additional dependencies?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct. It is just an example, I'll add a comment telling users that they can change the base image as necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0970da6

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM vllm/vllm-openai:latest

you can change the base image here. but even if you change the base image,

RUN uv pip install --system vllm[audio,video]

this line will install the latest released version, it will not keep the current vllm in the docker.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see what you mean now... hmm, how can we only install the extras without the main package?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which license is it that's problematic? If we could find an alternative then we can package everything in the container

Copy link
Member Author

@DarkLight1337 DarkLight1337 Feb 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which license is it that's problematic? If we could find an alternative then we can package everything in the container

See #8030

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know either. maybe just add comment to explicitly mention this limitation?

Is the vLLM directory inside the Docker container? Perhaps we can pip install from it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it has the vllm directory. vllm/vllm-openai is for deployment, and vllm is installed as a pip package.

Copy link
Member Author

@DarkLight1337 DarkLight1337 Feb 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, to keep things simple I have included a specific version of vLLM in the example.

```

:::

:::{tip}
Some new models may not have been released on [HF Transformers](https://github.com/huggingface/transformers) yet.

To use the development version of `transformers`, create a custom Dockerfile on top of the base image
with an extra layer that installs their code from source:

```Dockerfile
FROM vllm/vllm-openai:latest

RUN uv pip install --system git+https://github.com/huggingface/transformers.git
```

:::

(deployment-docker-build-image-from-source)=

## Building vLLM's Docker Image from Source
Expand Down