Demo Qwen
Code
1from kern.agent import Agent2from kern.models.ollama import Ollama3from kern.tools.yfinance import YFinanceTools45agent = Agent(6 model=Ollama(id="qwen3:8b"),7 tools=[8 YFinanceTools(9 stock_price=True,10 analyst_recommendations=True,11 company_info=True,12 company_news=True,13 ),14 ],15 instructions="Use tables to display data.",16)1718agent.print_response("Write a report on NVDA", stream=True, markdown=True)Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateInstall Ollama
Follow the Ollama installation guide and run:
1ollama pull qwen3:8bInstall dependencies
1uv pip install -U ollama kern-aiRun Agent
1python cookbook/11_models/ollama/demo_qwen.py