Posts about llm
2 posts
-
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.
-
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.