MATHIS/index
← Back to the index

N°001 · 21 September 2026

LangChain agents with local LLMs

Tool-using agents, streaming, runtime context and dynamic prompts with LangChain, all running locally on Llama 3.2 through Ollama.

Difficulty
★★★ Exploration
Status
Done
Topics
#langchain #agents #llm

What I built

A hands-on run through LangChain’s agent API, using local models through Ollama (Llama 3.2 3B).

  • Basic chat models and multi-turn conversations with system/human/AI messages
  • Streaming responses so the user doesn’t wait for the full generation
  • A tool-using agent that calls a weather API
  • Runtime context, so the agent infers the user’s city instead of asking for it
  • Middleware: dynamic system prompts, structured response formats and dynamic model selection