All writing
Open Source·November 5, 2025·9 min read

Building an LLM Agent Runtime From Scratch

I built the tool-calling loop by hand instead of reaching for a framework abstraction, to see exactly how an agent requests tools, runs them, and reasons over the results.

AIlangchainazure-openaitool-callingstreamlit
View the repo on GitHub

Why from scratch

Frameworks hide the agent loop. Writing it by hand makes the mechanics obvious: the model asks for a tool, the runtime executes it, and the result goes back for another round until the model has an answer.

What's in it

A manual tool-calling agent over Azure OpenAI with Wikipedia and Tavily search tools, dynamic routing, error handling, and full message tracing, plus a streaming Streamlit chatbot with model selection and conversation history.