Llm Candidate Bakeoff
Uses an LLM to select the best match from multiple candidates.
This is more efficient than evaluating candidates one-by-one, and allows the LLM to compare and contrast options. Uses structured output for reliable parsing.
Two built-in prompt strategies are available in BakeoffPromptStrategies:
BakeoffPromptStrategies.COMPACT: Minimal prompts (~100-200 tokens) for fast, cheap resolution. Does not include descriptions - may cause issues with similarly-named entities.
BakeoffPromptStrategies.FULL: Detailed prompts (~400-600 tokens) for complex disambiguation.
Custom strategies can be implemented for domain-specific prompt requirements.
Returns the best matching candidate, or null if none match.
Example usage (Java-friendly builder):
var bakeoff = LlmCandidateBakeoff
.withLlm(llmOptions)
.withAi(ai)
.withPromptStrategy(BakeoffPromptStrategies.FULL);Parameters
LLM configuration (model, temperature, etc.)
The Embabel AI instance for LLM calls
Strategy for building prompts (default: COMPACT)
Constructors
Functions
Select the best matching candidate from a list.
Set the prompt strategy.