Skip to main content

hackagent.models.completions.litellm

Model implementation backed directly by LiteLLM.

KNOWN_LITELLM_PROVIDER_PREFIXES​

LiteLLM provider prefixes a model string may already carry.

uses_alternative_auth​

def uses_alternative_auth(model: str) -> bool

Providers that use local access or cloud identity instead of an API key.

resolve_litellm_model​

def resolve_litellm_model(raw_model: str,
*,
provider_prefix: Optional[str] = None) -> str

Return the model string to pass to litellm.completion.

Honors a caller-supplied provider_prefix while leaving names that already carry an explicit LiteLLM provider prefix untouched.

normalise_ollama_endpoint​

def normalise_ollama_endpoint(endpoint: Optional[str]) -> str

Resolve and normalise an Ollama endpoint URL to its base form.

LiteLLMModel Objects​

class LiteLLMModel(Model)

Execute synchronous and asynchronous LiteLLM completions.

complete​

def complete(messages: Sequence[Mapping[str, Any]],
**overrides: Any) -> ModelResponse

Run a synchronous LiteLLM completion.

acomplete​

async def acomplete(messages: Sequence[Mapping[str, Any]],
**overrides: Any) -> ModelResponse

Run an asynchronous LiteLLM completion.