In this article, you will learn how to turn repeated zero-shot predictions from a local LLM into calibrated confidence scores with scikit-llm, and how to use those scores to route uncertain predictions to human review.
Topics we will cover include:
How to set up a free, local Llama 3.1 8B model with Ollama and connect it to scikit-llm.
How to build a self-consistency wrapper that converts repeated zero-shot predictions into class probabilities, and how to check its calibration with a reliability diagram.
How to use a confidence threshold to send uncertain predictions to human review instead of acting on them automatically.
Introduction
Most of the latest large language models — commonly referred to by their abbreviation, LLMs — are excellent zero-shot classifiers; i.e.…