Basic Agent
Code
1from kern.agent import Agent2from kern.models.vllm import VLLM34agent = Agent(5 model=VLLM(id="Qwen/Qwen2.5-7B-Instruct", top_k=20, enable_thinking=False),6 markdown=True,7)89agent.print_response("Share a 2 sentence horror story")Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSetup vLLM Server
Start a vLLM server locally:
1uv pip install vllm2python -m vllm.entrypoints.openai.api_server \3 --model Qwen/Qwen2.5-7B-Instruct \4 --port 8000Install dependencies
1uv pip install -U openai kern-aiRun Agent
1python cookbook/11_models/vllm/basic.py