Claude Prompt Caching + MIPROv2? #1440
Closed
MattKravetz
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm curious if anyone has had success using Claude Prompt Caching (https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching) with MIPROv2?
My use case involves processing (potentially large) press articles with a series of
dspy.Modules. I am able to leverage prompt caching in my unoptimized program by instantiating a newdspy.Claudeobject. Roughly:I'm now trying to leverage a similar approach with MIPROv2, but I'm hitting issues as it seems the LMs need to be passed into the optimizer constructor (https://github.com/stanfordnlp/dspy/blob/main/dspy/teleprompt/mipro_optimizer_v2.py#L99-L100).
Since I'd like to include multiple different articles in my optimization pass, it's not clear if my unoptimized approach (creating a new
lminstance for each distinct article) will work here.Would anyone happen to know if this is possible?
Beta Was this translation helpful? Give feedback.
All reactions