Skip to content

LLM Validator: Improve questions and prompt generation#317

Merged
academo merged 15 commits intomainfrom
academo/update-llm-validator
Apr 1, 2025
Merged

LLM Validator: Improve questions and prompt generation#317
academo merged 15 commits intomainfrom
academo/update-llm-validator

Conversation

@academo
Copy link
Copy Markdown
Collaborator

@academo academo commented Mar 31, 2025

main change

It now asks the model one question at the time instead of all questions at once.

This change allows the model to focus on replying a single question which greatly improves its answers. It also means the validator now consumes more api credits from google when running.

Other changes

  • Updates the LLM model to use gemini-2.0-flash-001 (stable gemini flash 2)
  • Changes the question structure to have an expected answer instead of always expecting a positive
  • Adds structured output to LLM
  • Adds more questions for code
  • Moves retrial logic to per-question

@academo academo marked this pull request as ready for review March 31, 2025 21:06
@academo academo requested review from a team as code owners March 31, 2025 21:06
@academo academo requested review from oshirohugo, wbrowne and xnyo and removed request for a team March 31, 2025 21:06
@academo academo moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team Mar 31, 2025
@academo academo self-assigned this Mar 31, 2025
@academo academo added the enhancement New feature or request label Mar 31, 2025
Comment thread pkg/llmvalidate/llmvalidate.go Outdated
Copy link
Copy Markdown
Member

@xnyo xnyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this but the code LGTM apart from a few minor nitpicks. Awesome work! 🙌

Answer string `json:"answer"`
Files []string `json:"files"`
ShortAnswer bool `json:"short_answer"`
ExpectedShortAnswer bool
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: You should mark the field with a json:"-" tag if you want to make the json encoder/decoder ignore it:

Comment thread pkg/llmvalidate/llmvalidate.go Outdated
@academo academo merged commit 0b36358 into main Apr 1, 2025
2 checks passed
@academo academo deleted the academo/update-llm-validator branch April 1, 2025 17:38
@github-project-automation github-project-automation Bot moved this from 🔬 In review to 🚀 Shipped in Grafana Catalog Team Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants