Salmanap/fix docs new providers model alias (#571)

* fixed docs and added ollama as a first-class LLM provider

* matching the LLM routing section on the README.md to the docs

* updated the section on preference-based routing

---------

Co-authored-by: Salman Paracha <salmanparacha@MacBook-Pro-167.local>
This commit is contained in:
Salman Paracha 2025-09-19 10:19:57 -07:00 committed by GitHub
parent 8d0b468345
commit fbe82351c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 1696 additions and 150 deletions

View file

@ -16,6 +16,7 @@ pub enum ProviderId {
AzureOpenAI,
XAI,
TogetherAI,
Ollama,
}
impl From<&str> for ProviderId {
@ -32,6 +33,7 @@ impl From<&str> for ProviderId {
"azure_openai" => ProviderId::AzureOpenAI,
"xai" => ProviderId::XAI,
"together_ai" => ProviderId::TogetherAI,
"ollama" => ProviderId::Ollama,
_ => panic!("Unknown provider: {}", value),
}
}
@ -55,7 +57,8 @@ impl ProviderId {
| ProviderId::GitHub
| ProviderId::AzureOpenAI
| ProviderId::XAI
| ProviderId::TogetherAI,
| ProviderId::TogetherAI
| ProviderId::Ollama,
SupportedAPIs::AnthropicMessagesAPI(_)) => SupportedAPIs::OpenAIChatCompletions(OpenAIApi::ChatCompletions),
(ProviderId::OpenAI
@ -67,7 +70,8 @@ impl ProviderId {
| ProviderId::GitHub
| ProviderId::AzureOpenAI
| ProviderId::XAI
| ProviderId::TogetherAI,
| ProviderId::TogetherAI
| ProviderId::Ollama,
SupportedAPIs::OpenAIChatCompletions(_)) => SupportedAPIs::OpenAIChatCompletions(OpenAIApi::ChatCompletions),
}
}
@ -87,6 +91,7 @@ impl Display for ProviderId {
ProviderId::AzureOpenAI => write!(f, "azure_openai"),
ProviderId::XAI => write!(f, "xai"),
ProviderId::TogetherAI => write!(f, "together_ai"),
ProviderId::Ollama => write!(f, "ollama"),
}
}
}