Overview#
Developed a terminal-based conversational agent running locally on Ollama utilizing Llama 3 for tool use and structured JSON parsing.
Designed a robust control loop orchestrating a system prompt, dynamic tool schemas, and a history array passed to the model on every iteration.
Implemented a runtime dispatcher in Python executing functions like weather fetching or SQLite database operations based on the model’s tool calls.
Engineered strict Pydantic models mapping tool calls to Python functions ensuring robust JSON validation and error handling.
Managed conversational state utilizing a local SQLite store persisting interaction histories and minimizing latency for rapid testing.
Tech Stack#
Python
Control loop & dispatcher
Ollama
Local model inference
Llama 3
Tool calling LLM
SQLite
Conversational state store
Pydantic
Data & schema validation