Skip to main content
Generate Python code with DeepSeek Coder served by vLLM.
code_generation.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your vLLM API key

4

Install vLLM

Install vLLM on a supported platform with a compatible accelerator:
5

Start vLLM

In a separate terminal with the virtual environment active, serve the model used by this example:
6

Run the example

Save the code above as code_generation.py, then run:
Full source: cookbook/90_models/vllm/code_generation.py