Async Agent
Code
1import asyncio23from kern.agent import Agent4from kern.models.vllm import VLLM56agent = Agent(model=VLLM(id="Qwen/Qwen2.5-7B-Instruct"), markdown=True)7asyncio.run(agent.aprint_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\activateInstall dependencies
1uv pip install -U kern-ai openai vllmStart vLLM server
1vllm serve Qwen/Qwen2.5-7B-Instruct \2 --enable-auto-tool-choice \3 --tool-call-parser hermes \4 --dtype float16 \5 --max-model-len 8192 \6 --gpu-memory-utilization 0.9Run Agent
1python cookbook/11_models/vllm/async_basic.py