MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / _extract_provider

Function _extract_provider

openkb/cli.py:97–108  ·  view source on GitHub ↗

Extract the LiteLLM provider name from a model string. ``model`` uses ``provider/model`` LiteLLM format. OpenAI models can omit the prefix; default to ``"openai"``.

(model: str)

Source from the content-addressed store, hash-verified

95
96
97def _extract_provider(model: str) -> str | None:
98 """Extract the LiteLLM provider name from a model string.
99
100 ``model`` uses ``provider/model`` LiteLLM format.
101 OpenAI models can omit the prefix; default to ``"openai"``.
102 """
103 model = model.strip()
104 if not model:
105 return None
106 if "/" in model:
107 return model.split("/")[0].lower()
108 return "openai"
109
110
111def _apply_litellm_settings(settings: dict) -> None:

Callers 1

_setup_llm_keyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected