feat(openai): support explicit prompt cache breakpoints#3719
Conversation
…prompt-caching # Conflicts: # pkg/chat/chat.go
|
I would love to see some before/after numbers |
|
Measured against the Docker staging models gateway with The benchmark used 10 interleaved requests per variant: 1 cold request and 9 warm requests, a stable ~4.7k-token system prefix, isolated per-variant cache namespaces, a changing user nonce,
Input cost uses $1/M fresh tokens, $0.10/M cache reads, and $1.25/M cache writes; output cost was excluded because output length was fixed. Latency was effectively flat, but the cache behavior and input cost improved substantially: |
Summary
CacheControlmessage boundaries into OpenAI explicit prompt-cache breakpoints on GPT-5.6+Issue expectations
openaiconfigurations with a custombase_urlreceive no explicit-cache fieldsDesign
prompt_cache_optionsremains omitted, preserving the default implicit breakpoint while adding explicit stable boundaries.Validation
go build ./...go test -count=1 ./...-racetask --force lintCloses #3705