Module llm_validation

Module llm_validation 

Source
Expand description

LLM provider/model compatibility helpers.

Gestura supports multiple LLM providers. Some model ids are provider-specific (e.g. grok-* for Grok, claude-* for Anthropic). This module provides a best-effort guardrail to prevent persisting obviously invalid (provider, model) pairs into session-scoped configuration.

Notes:

  • This intentionally errs on the side of allowing unknown/custom model ids.
  • Providers with user-defined model ids (e.g. Ollama) are treated as compatible.

Functionsยง

infer_provider_from_model_id
Attempt to infer the provider a model id belongs to.
is_model_compatible_with_provider
Returns true if the model_id is compatible with provider.
validate_model_for_provider
Validate a (provider, model) pair and return a user-facing error on mismatch.