feat: support zhipuai client (#491)

pull/493/head
sigoden 2 weeks ago committed by GitHub
parent 0071d84aa5
commit 956a960390
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -63,6 +63,7 @@ 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 \
)
# @cmd Chat with any LLM api

@ -115,8 +115,8 @@ clients:
# See https://cloud.google.com/vertex-ai
- type: vertexai
project_id: xxx # ENV: {client}_PROJECT_ID
location: xxx # ENV: {client}_LOCATION
project_id: xxx # ENV: {client}_PROJECT_ID
location: xxx # ENV: {client}_LOCATION
# Specifies a application-default-credentials (adc) file, Optional field
# Run `gcloud auth application-default login` to init the adc file
# see https://cloud.google.com/docs/authentication/external/set-up-adc
@ -133,8 +133,8 @@ clients:
# See https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
- type: vertexai-claude
project_id: xxx # ENV: {client}_PROJECT_ID
location: xxx # ENV: {client}_LOCATION
project_id: xxx # ENV: {client}_PROJECT_ID
location: xxx # ENV: {client}_LOCATION
# Specifies a application-default-credentials (adc) file, Optional field
# Run `gcloud auth application-default login` to init the adc file
# see https://cloud.google.com/docs/authentication/external/set-up-adc
@ -142,9 +142,9 @@ clients:
# See https://docs.aws.amazon.com/bedrock/latest/userguide/
- type: bedrock
access_key_id: xxx # ENV: {client}_ACCESS_KEY_ID
secret_access_key: xxx # ENV: {client}_SECRET_ACCESS_KEY
region: xxx # ENV: {client}_REGION
access_key_id: xxx # ENV: {client}_ACCESS_KEY_ID
secret_access_key: xxx # ENV: {client}_SECRET_ACCESS_KEY
region: xxx # ENV: {client}_REGION
# See https://developers.cloudflare.com/workers-ai/
- type: cloudflare
@ -157,23 +157,28 @@ clients:
# See https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html
- type: ernie
api_key: xxx # ENV: {client}_API_KEY
secret_key: xxxx # ENV: {client}_SECRET_KEY
api_key: xxx # ENV: {client}_API_KEY
secret_key: xxxx # ENV: {client}_SECRET_KEY
# See https://help.aliyun.com/zh/dashscope/
- type: qianwen
api_key: sk-xxx # ENV: {client}_API_KEY
api_key: sk-xxx # ENV: {client}_API_KEY
# See https://platform.moonshot.cn/docs/intro
- type: openai-compatible
name: moonshot
api_base: https://api.moonshot.cn/v1
api_key: sk-xxx # ENV: {client}_API_KEY
api_key: sk-xxx # ENV: {client}_API_KEY
# See https://platform.deepseek.com/api-docs/
- type: openai-compatible
name: deepseek
api_key: sk-xxx # ENV: {client}_API_KEY
api_key: sk-xxx # ENV: {client}_API_KEY
# See https://open.bigmodel.cn/dev/howuse/introduction
- type: openai-compatible
name: zhipuai
api_key: xxx # ENV: {client}_API_KEY
# See https://docs.endpoints.anyscale.com/
- type: openai-compatible

@ -461,9 +461,9 @@
output_price: 8.4
- platform: deepseek
docs:
- https://platform.deepseek.com/api-docs/
- https://platform.deepseek.com/api-docs/pricing
# docs:
# - https://platform.deepseek.com/api-docs/
# - https://platform.deepseek.com/api-docs/pricing
models:
- name: deepseek-chat
max_input_tokens: 32768
@ -474,6 +474,24 @@
input_price: 0.14
output_price: 0.28
- platform: zhipuai
# docs:
# - https://open.bigmodel.cn/dev/howuse/model
# - https://open.bigmodel.cn/pricing
models:
- name: glm-4
max_input_tokens: 128000
input_price: 14
output_price: 14
- name: glm-4v
max_input_tokens: 2048
input_price: 14
output_price: 14
- name: glm-3-turbo
max_input_tokens: 128000
input_price: 0.7
output_price: 0.7
- platform: anyscale
# docs:
# - https://docs.endpoints.anyscale.com/text-generation/query-a-model/#select-a-model

@ -45,7 +45,7 @@ register_client!(
(qianwen, "qianwen", QianwenConfig, QianwenClient),
);
pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 11] = [
pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 12] = [
("anyscale", "https://api.endpoints.anyscale.com/v1"),
("deepinfra", "https://api.deepinfra.com/v1/openai"),
("deepseek", "https://api.deepseek.com"),
@ -57,4 +57,5 @@ pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 11] = [
("octoai", "https://text.octoai.run/v1"),
("perplexity", "https://api.perplexity.ai"),
("together", "https://api.together.xyz/v1"),
("zhipuai", "https://open.bigmodel.cn/api/paas/v4"),
];

Loading…
Cancel
Save