MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / create_fallback_model

Function create_fallback_model

codewiki/src/be/llm_services.py:121–130  ·  view source on GitHub ↗

Create the fallback LLM model from configuration.

(config: Config)

Source from the content-addressed store, hash-verified

119 if choice.index is None:
120 choice.index = i
121 return super()._validate_completion(response)
122
123
124class 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

Callers 1

create_fallback_modelsFunction · 0.85

Calls 2

_build_model_settingsFunction · 0.85

Tested by

no test coverage detected