diff --git a/Argcfile.sh b/Argcfile.sh index d36cd016..4cd53d83 100755 --- a/Argcfile.sh +++ b/Argcfile.sh @@ -97,6 +97,7 @@ OPENAI_COMPATIBLE_PLATFORMS=( \ qianwen,qwen-turbo,https://dashscope.aliyuncs.com/compatible-mode/v1 \ siliconflow,meta-llama/Meta-Llama-3.1-8B-Instruct,https://api.siliconflow.cn/v1 \ together,meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo,https://api.together.xyz/v1 \ + xai,grok-beta,https://api.x.ai/v1 \ zhipuai,glm-4-0520,https://open.bigmodel.cn/api/paas/v4 \ ) diff --git a/config.example.yaml b/config.example.yaml index c46fbf0a..6af2ee65 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -165,6 +165,12 @@ clients: api_base: https://api.mistral.ai/v1 api_key: xxx + # See https://docs.x.ai/docs + - type: openai-compatible + name: xai + api_base: https://api.x.ai/v1 + api_key: xxx + # See https://docs.ai21.com/docs/quickstart - type: openai-compatible name: ai12 diff --git a/models.yaml b/models.yaml index 10c6592a..4d7b4526 100644 --- a/models.yaml +++ b/models.yaml @@ -277,6 +277,17 @@ type: reranker max_input_tokens: 4096 +# Links: +# - https://docs.x.ai/docs#models +# - https://cohere.com/pricing +# - https://docs.x.ai/api/endpoints#chat-completions +- platform: xai + models: + - name: grok-beta + max_input_tokens: 131072 + input_price: 5 + output_price: 10 + # Links: # - https://docs.perplexity.ai/guides/model-cards # - https://docs.perplexity.ai/guides/pricing diff --git a/src/client/mod.rs b/src/client/mod.rs index 24ced99c..883d5f7b 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -35,7 +35,7 @@ register_client!( (ernie, "ernie", ErnieConfig, ErnieClient), ); -pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 20] = [ +pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 21] = [ ("ai21", "https://api.ai21.com/studio/v1"), ("cloudflare", ""), ("deepinfra", "https://api.deepinfra.com/v1/openai"), @@ -56,6 +56,7 @@ pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 20] = [ ), ("siliconflow", "https://api.siliconflow.cn/v1"), ("together", "https://api.together.xyz/v1"), + ("xai", "https://api.x.ai/v1"), ("zhipuai", "https://open.bigmodel.cn/api/paas/v4"), // RAG-dedicated ("jina", "https://api.jina.ai/v1"),