> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 代码生成

## 代码

```python cookbook/models/vllm/code_generation.py theme={null}
from agno.agent import Agent
from agno.models.vllm import vLLM

agent = Agent(
    model=vLLM(id="deepseek-ai/deepseek-coder-6.7b-instruct"),
    description="You are an expert Python developer.",
    markdown=True,
)

agent.print_response(
    """编写一个 Python 函数，使用动态规划返回第 n 个斐波那契数。"""
)
```

## 用法

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="安装库">
    ```bash theme={null}
    pip install -U agno openai vllm
    ```
  </Step>

  <Step title="启动 vLLM 服务">
    ```bash theme={null}
    vllm serve deepseek-ai/deepseek-coder-6.7b-instruct \
        --dtype float32 \
        --tool-call-parser pythonic
    ```
  </Step>

  <Step title="运行 Agent">
    ```bash theme={null}
    python cookbook/models/vllm/code_generation.py
    ```
  </Step>
</Steps>
