Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate ollama/qianwen clients to openai-compatible #816

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ clients:
api_base: http://localhost:8080/v1
api_key: xxx # Optional
chat_endpoint: /chat/completions # Optional
embeddings_endpoint: /embeddings # Optional
models:
- name: llama3.1
max_input_tokens: 128000
Expand Down Expand Up @@ -181,9 +182,9 @@ clients:
api_base: https://api.groq.com/openai/v1

# See https://github.com/jmorganca/ollama
- type: ollama
api_base: http://localhost:11434
api_auth: Basic xxx # optional
- type: openai-compatible
name: ollama
api_base: http://localhost:11434/v1
models:
- name: llama3.1
max_input_tokens: 128000
Expand Down Expand Up @@ -252,9 +253,10 @@ clients:
secret_key: xxxx

# See https://help.aliyun.com/zh/dashscope/
- type: qianwen
- type: openai-compatible
name: qianwen
api_key: sk-xxx
api_base: https://dashscope.aliyuncs.com/api/v1 # Optional
api_base: https://dashscope.aliyuncs.com/compatible-mode/v1

# See https://platform.moonshot.cn/docs/intro
- type: openai-compatible
Expand Down
9 changes: 6 additions & 3 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ register_client!(
(gemini, "gemini", GeminiConfig, GeminiClient),
(claude, "claude", ClaudeConfig, ClaudeClient),
(cohere, "cohere", CohereConfig, CohereClient),
(ollama, "ollama", OllamaConfig, OllamaClient),
(
azure_openai,
"azure-openai",
Expand All @@ -37,10 +36,9 @@ register_client!(
(cloudflare, "cloudflare", CloudflareConfig, CloudflareClient),
(replicate, "replicate", ReplicateConfig, ReplicateClient),
(ernie, "ernie", ErnieConfig, ErnieClient),
(qianwen, "qianwen", QianwenConfig, QianwenClient),
);

pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 16] = [
pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 18] = [
("ai21", "https://api.ai21.com/studio/v1"),
("deepinfra", "https://api.deepinfra.com/v1/openai"),
("deepseek", "https://api.deepseek.com"),
Expand All @@ -53,7 +51,12 @@ pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 16] = [
("moonshot", "https://api.moonshot.cn/v1"),
("openrouter", "https://openrouter.ai/api/v1"),
("octoai", "https://text.octoai.run/v1"),
("ollama", "http://localhost:11434/v1"),
("perplexity", "https://api.perplexity.ai"),
(
"qianwen",
"https://dashscope.aliyuncs.com/compatible-mode/v1",
),
("together", "https://api.together.xyz/v1"),
("zhipuai", "https://open.bigmodel.cn/api/paas/v4"),
("voyageai", "https://api.voyageai.com/v1"),
Expand Down
291 changes: 0 additions & 291 deletions src/client/ollama.rs

This file was deleted.

Loading