Posts about llm

2 posts

  1. Validating LLM JSON output with Pydantic and a repair retry

    Treat model output as untrusted input: define a Pydantic schema, validate the JSON an LLM returns, and feed validation errors back for one bounded repair attempt.

    3 min read

  2. Measuring RAG retrieval quality with recall@k and MRR

    A small, practical way to test the retrieval step of a RAG system: build a labelled question set, compute recall@k and MRR in Python, and compare chunking settings.

    3 min read