Code
tool_use.py
Usage
1
Set up your virtual environment
2
Set the API key
3
Install Libraries
4
Start vLLM server
5
Run Agent
Save the code above as
tool_use.py, then run:Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Run a tool-enabled agent against a local vLLM server.
from agno.agent import Agent
from agno.models.vllm import VLLM
from agno.tools.websearch import WebSearchTools
agent = Agent(
model=VLLM(
id="NousResearch/Nous-Hermes-2-Mistral-7B-DPO", top_k=20, enable_thinking=False
),
tools=[WebSearchTools()],
markdown=True,
)
agent.print_response("Whats happening in France?")
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Set the API key
export VLLM_API_KEY=xxx
Install Libraries
uv pip install -U agno openai vllm ddgs
Start vLLM server
vllm serve NousResearch/Nous-Hermes-2-Mistral-7B-DPO \
--enable-auto-tool-choice \
--tool-call-parser hermes \
--dtype float16 \
--max-model-len 8192 \
--gpu-memory-utilization 0.9
Run Agent
tool_use.py, then run:python tool_use.py
Was this page helpful?