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: support lingyiwanwu client #613

Merged
merged 1 commit into from
Jun 18, 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
3 changes: 2 additions & 1 deletion Argcfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ OPENAI_COMPATIBLE_PLATFORMS=( \
octoai,meta-llama-3-8b-instruct,https://text.octoai.run/v1 \
perplexity,llama-3-8b-instruct,https://api.perplexity.ai \
together,meta-llama/Llama-3-8b-chat-hf,https://api.together.xyz/v1 \
zhipuai,glm-4,https://open.bigmodel.cn/api/paas/v4 \
zhipuai,glm-4-0520,https://open.bigmodel.cn/api/paas/v4 \
lingyiwanwu,yi-large,https://api.lingyiwanwu.com/v1 \
)

# @cmd Chat with any LLM api
Expand Down
4 changes: 2 additions & 2 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ clients:
api_key: xxx # ENV: {client}_API_KEY
patches:
'.*':
chat_completions_body: # Override safetySettings for all models
chat_completions_body:
safetySettings:
- category: HARM_CATEGORY_HARASSMENT
threshold: BLOCK_NONE
Expand Down Expand Up @@ -178,7 +178,7 @@ clients:
adc_file: <path-to/gcloud/application_default_credentials.json>
patches:
'gemini-.*':
chat_completions_body: # Override safetySettings for all gemini models
chat_completions_body:
safetySettings:
- category: HARM_CATEGORY_HARASSMENT
threshold: BLOCK_ONLY_HIGH
Expand Down
35 changes: 35 additions & 0 deletions models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,41 @@
output_price: 7
supports_vision: true

- platform: lingyiwanwu
# docs:
# - https://platform.lingyiwanwu.com/docs#%E6%A8%A1%E5%9E%8B
# - https://platform.lingyiwanwu.com/docs#%E8%AE%A1%E8%B4%B9%E5%8D%95%E5%85%83
models:
- name: yi-large
max_input_tokens: 32768
input_price: 2.8
output_price: 2.8
- name: yi-medium
max_input_tokens: 16384
input_price: 0.35
output_price: 0.35
- name: yi-vision
max_input_tokens: 4096
input_price: 0.84
output_price: 0.84
supports_vision: true
- name: yi-medium-200k
max_input_tokens: 200000
input_price: 1.68
output_price: 1.68
- name: yi-spark
max_input_tokens: 16384
input_price: 0.14
output_price: 0.14
- name: yi-large-rag
max_input_tokens: 16384
input_price: 3.5
output_price: 3.5
- name: yi-large-turbo
max_input_tokens: 16384
input_price: 1.68
output_price: 1.68

- platform: anyscale
# docs:
# - https://docs.anyscale.com/endpoints/text-generation/supported-models/meta-llama-Meta-Llama-3-8B-Instruct
Expand Down
3 changes: 2 additions & 1 deletion src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ register_client!(
(qianwen, "qianwen", QianwenConfig, QianwenClient),
);

pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 12] = [
pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 13] = [
("anyscale", "https://api.endpoints.anyscale.com/v1"),
("deepinfra", "https://api.deepinfra.com/v1/openai"),
("deepseek", "https://api.deepseek.com"),
Expand All @@ -58,4 +58,5 @@ pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 12] = [
("perplexity", "https://api.perplexity.ai"),
("together", "https://api.together.xyz/v1"),
("zhipuai", "https://open.bigmodel.cn/api/paas/v4"),
("lingyiwanwu", "https://api.lingyiwanwu.com/v1"),
];