Nous.ModelDispatcher (nous v0.16.0)
View SourceDispatches model requests to the appropriate provider implementation.
Routes requests to providers based on the model's provider field:
:anthropic→Nous.Providers.Anthropic:gemini→Nous.Providers.Gemini:mistral→Nous.Providers.Mistral:lmstudio→Nous.Providers.LMStudio:llamacpp→Nous.Providers.LlamaCpp:vllm→Nous.Providers.VLLM:sglang→Nous.Providers.SGLang:openai→Nous.Providers.OpenAI:custom→Nous.Providers.Custom- Others →
Nous.Providers.OpenAICompatible
Summary
Functions
Count tokens (uses appropriate provider implementation).
Dispatch request to the appropriate provider implementation.
Dispatch streaming request to the appropriate provider implementation.
Functions
@spec count_tokens(Nous.Model.t(), list()) :: integer()
Count tokens (uses appropriate provider implementation).
@spec request(Nous.Model.t(), list(), map()) :: {:ok, map()} | {:error, term()}
Dispatch request to the appropriate provider implementation.
@spec request_stream(Nous.Model.t(), list(), map()) :: {:ok, Enumerable.t()} | {:error, term()}
Dispatch streaming request to the appropriate provider implementation.