You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session affinity (for prompt caching) per provider #229
It seems that OCR currently lacks explicit session affinity control.
Depending on the provider, it may need to provide an explicit header to enable prompt caching.
OpenAI: prompt_cache_key in body.
Anthropic: don't use explicit parameter. (undeterministic)
Cloudflare/Fireworks/Mistral/others: Commonly x-session-affinity in header.
Since the "session" must be managed by OCR, users cannot provide the provider themselves.
Proposed Solution
Define the session key in OCR's lifecycle. Maybe related to #59 (comment)
Inject it to the request, or provide a template variable so that the user can configure extra_headers directly. e.g. x-session-affinity: {ocr_session_key}
Activity
feat(llm): task-scoped session affinity for prompt caching
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity via {ocr_session_key} templat…
feat(llm): task-scoped session affinity for prompt caching (alibaba#332)
feat(llm): task-scoped session affinity for prompt caching (alibaba#332)