Create the fallback LLM model from configuration.
(config: Config)
| 119 | if choice.index is None: |
| 120 | choice.index = i |
| 121 | return super()._validate_completion(response) |
| 122 | |
| 123 | |
| 124 | class CachingOpenAIModel(CompatibleOpenAIModel): |
| 125 | """CompatibleOpenAIModel that adds Anthropic-style prompt-cache breakpoints. |
| 126 | |
| 127 | Injects ``cache_control: {"type": "ephemeral"}`` markers into the |
| 128 | OpenAI-format payload at two points: the last system message (on Anthropic |
| 129 | this caches the tools + system prefix) and the final message (incremental |
| 130 | multi-turn caching — each turn reads the longest previously cached prefix |
| 131 | and extends it). OpenAI-compatible proxies such as LiteLLM forward the |
| 132 | markers to providers that support prompt caching; providers that don't |
| 133 | either ignore the field or reject the request with a 4xx, in which case the |
no test coverage detected