[guide] Prompt versioning guide - #53
Conversation
|
Thanks @lucifertrj — this is a solid start and it runs clean in dry-run (I checked out the branch: Before we merge, we'd like to take this in a slightly different direction that we think teaches prompt versioning better and fits the Why a notebook3 of the 4 existing guides in this repo are notebooks ( The one conceptual change that matters mostRight now the guide uses two prompts: Also: the prompt name shouldn't contain Your existing Target cell-by-cell flow
Concrete fixes to fold in
Notebook conventions to follow (lighter contract than scripts)
Heads-up on CI: notebook execution ( Future direction — a fintech-assistant use-case (separate follow-up)One more thought: the fintech-advisor prompt you wrote (the compliance-reviewed We've opened #62 to track it — we'd love for you to take it if you're interested (you'd get first claim as the originator). Keeping it separate from this PR lets the guide land cleanly first. If you'd rather we take it from here and land it with a |
|
Understood. I can pick up and resolve the Concrete fixes to fold in section within 1 to 2 weeks. I'm also fine with the notebook being Co-authored-by. If no one picks it up by the end of the month, I'll do it myself. |
…k SDK Score existing production traces in an Opik project from your own pipeline using stock SDK judges/metrics (Hallucination, G-Eval, a custom ExactMatch) routed through a GenAI gateway, and log feedback (with reasons) back onto the traces under the same names an online rule would use. Composes three public SDK primitives — search_traces -> metric.score() -> log_traces_feedback_scores — with per-eval error isolation, one batched write, and a DRY_RUN-safe entry (exits 0 without credentials). G-Eval receives a labeled INPUT/OUTPUT payload so relevance is judged against the question. Runs as plain scripts (uv run python score_traces.py / utils/seed_traces.py); 18 unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…y ruff format Compliance requires litellm examples to reference OPIK_EXAMPLES_MODEL so CI can route judges to a cheap model; model.py now reads it (GATEWAY_MODEL stays the local override). Also ran `ruff format` — the lint job checks `ruff format --check .`, not just `ruff check`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Notebook walks a single earnings-call-summarizer prompt through the full loop: commit versions, fetch by hash, compare for hallucination as side-by-side experiments, then run the winning version via LiteLLM. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@LeoRoccoBreedt (Why a notebook feedback): I have added the notebook i.e., the guide now carries a single prompt (earnings-call-summarizer) through the whole loop: commit v1/v2 → fetch by hash → side-by-side hallucination eval → traced inference on a new transcript. I have also resolved Concrete fixes to fold in feedback: i.e., fixed pyproject.toml deps (opik + litellm, no unused openai), updated README prose from "OpenAI SDK" to litellm, switched labeling to change_description=..., and added the guide to both README index tables. Notebook outputs are cleared for a clean diff. |
What & why
This PR adds the guide on: Creating and using prompt versions #43
Version prompts in the Opik Prompt Library, compare versions for hallucination before you
ship one, then run inference against whichever version is currently the latest commit
without hardcoding the prompt text into your application.
Checklist
integrations/guides/use-cases/scripts)lowercase_with_underscoresREADME.mdhas all required sections; index tables updated if examples were added/renamed/removedbash run.shexits cleanly (this is what CI's secrets-free job runs)uv run ruff check .anduv run ruff format --check .are clean.envfiles committedpyproject.toml(uv project); norequirements.txt, no committeduv.lockrun.shexists and starts withset -eOPIK_PROJECT_NAMEis set — exported inrun.sh(scripts) or defined inconfig.py(use-cases/guides)OPIK_EXAMPLES_MODEL