feat: ollama cloud support
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use crate::CloudflareCredentials;
|
||||
use crate::openai;
|
||||
use crate::server::AppState;
|
||||
use crate::server::Provider;
|
||||
use crate::server::Upstream;
|
||||
use crate::server::take_random_by_swapping;
|
||||
use axum::Json;
|
||||
@@ -36,6 +35,14 @@ pub enum Shortcut {
|
||||
M,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
enum Provider {
|
||||
CloudflareWorkersAi,
|
||||
LiquidAi,
|
||||
OpenRouter,
|
||||
VercelAiGateway,
|
||||
}
|
||||
|
||||
impl Shortcut {
|
||||
fn suggestions(&self) -> Vec<(Provider, EcoString)> {
|
||||
use Provider as P;
|
||||
@@ -53,6 +60,7 @@ impl Shortcut {
|
||||
(P::VercelAiGateway, "convaiinnovations/laya".into()),
|
||||
]
|
||||
}
|
||||
|
||||
S::M => {
|
||||
vec![
|
||||
(P::CloudflareWorkersAi, "clef".into()),
|
||||
@@ -118,10 +126,6 @@ pub async fn create_system_one(
|
||||
},
|
||||
)
|
||||
.collect(),
|
||||
Provider::GoogleAiStudio => unreachable!(),
|
||||
Provider::Groq => unreachable!(),
|
||||
Provider::HuggingFace => unreachable!(),
|
||||
Provider::Kilo => unreachable!(),
|
||||
Provider::LiquidAi => state
|
||||
.app_args
|
||||
.liquid_ai_api_key
|
||||
@@ -134,9 +138,6 @@ pub async fn create_system_one(
|
||||
.build()
|
||||
})
|
||||
.collect(),
|
||||
Provider::Mistral => unreachable!(),
|
||||
Provider::NovitaAi => unreachable!(),
|
||||
Provider::NvidiaNim => unreachable!(),
|
||||
Provider::OpenRouter => state
|
||||
.app_args
|
||||
.openrouter_api_key
|
||||
@@ -161,7 +162,6 @@ pub async fn create_system_one(
|
||||
.build()
|
||||
})
|
||||
.collect(),
|
||||
Provider::ZAi => unreachable!(),
|
||||
};
|
||||
|
||||
if let Ok(upstreams) = Vec1::try_from(upstreams) {
|
||||
|
||||
Reference in New Issue
Block a user