summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-08-22 06:41:16 +0800
committerGitHub <noreply@github.com>2024-08-22 06:41:16 +0800
commitf1cbb3c006fdbf0815a33800b62b66eb52a55a5f (patch)
treef8f8d6ef0a9bb8face3e984bbd07d8c8975abc15
parentc0eae1c55c0d48ed1c6f9f6cb2d8990deb163b37 (diff)
downloadaichat-f1cbb3c006fdbf0815a33800b62b66eb52a55a5f.tar.gz
feat: support github client (#798)
-rwxr-xr-xArgcfile.sh1
-rw-r--r--config.example.yaml6
-rw-r--r--models.yaml38
-rw-r--r--src/client/mod.rs3
4 files changed, 47 insertions, 1 deletions
diff --git a/Argcfile.sh b/Argcfile.sh
index 5ac1589..6f6e0e9 100755
--- a/Argcfile.sh
+++ b/Argcfile.sh
@@ -92,6 +92,7 @@ OPENAI_COMPATIBLE_PLATFORMS=( \
together,meta-llama/Llama-3-8b-chat-hf,https://api.together.xyz/v1 \
zhipuai,glm-4-0520,https://open.bigmodel.cn/api/paas/v4 \
lingyiwanwu,yi-large,https://api.lingyiwanwu.com/v1 \
+ github,meta-llama-3.1-8b-instruct,https://models.inference.ai.azure.com \
)
# @cmd Chat with any LLM api
diff --git a/config.example.yaml b/config.example.yaml
index d536998..ffb732a 100644
--- a/config.example.yaml
+++ b/config.example.yaml
@@ -268,6 +268,12 @@ clients:
api_key: xxx
api_base: https://api.deepinfra.com/v1/openai
+ # See https://github.com/marketplace/models
+ - type: openai-compatible
+ name: github
+ api_key: xxx
+ api_base: https://models.inference.ai.azure.com
+
# See https://readme.fireworks.ai/docs/quickstart
- type: openai-compatible
name: fireworks
diff --git a/models.yaml b/models.yaml
index 50dcacc..b42496a 100644
--- a/models.yaml
+++ b/models.yaml
@@ -724,6 +724,44 @@
input_price: 0.14
output_price: 0.14
+- platform: github
+ # docs:
+ # - https://github.com/marketplace/models
+ # - https://deepinfra.com/pricing
+ models:
+ - name: gpt-4o
+ max_input_tokens: 128000
+ supports_function_calling: true
+ - name: gpt-4o-mini
+ max_input_tokens: 128000
+ supports_function_calling: true
+ - name: meta-llama-3.1-405b-instruct
+ max_input_tokens: 128000
+ - name: meta-llama-3.1-70b-instruct
+ max_input_tokens: 128000
+ - name: meta-llama-3.1-8b-instruct
+ max_input_tokens: 128000
+ - name: meta-llama-3-70b-instruct
+ max_input_tokens: 8192
+ - name: meta-llama-3-8b-instruct
+ max_input_tokens: 8192
+ - name: mistral-large-2407
+ max_input_tokens: 128000
+ supports_function_calling: true
+ - name: mistral-nemo
+ max_input_tokens: 128000
+ supports_function_calling: true
+ - name: cohere-command-r-plus
+ max_input_tokens: 128000
+ supports_function_calling: true
+ - name: cohere-command-r
+ max_input_tokens: 128000
+ supports_function_calling: true
+ - name: phi-3-medium-128k-instruct
+ max_input_tokens: 128000
+ - name: phi-3-mini-128k-instruct
+ max_input_tokens: 128000
+
- platform: deepinfra
# docs:
# - https://deepinfra.com/models
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 80f526a..5a4a9ac 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -40,10 +40,11 @@ register_client!(
(qianwen, "qianwen", QianwenConfig, QianwenClient),
);
-pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 14] = [
+pub const OPENAI_COMPATIBLE_PLATFORMS: [(&str, &str); 15] = [
("deepinfra", "https://api.deepinfra.com/v1/openai"),
("deepseek", "https://api.deepseek.com"),
("fireworks", "https://api.fireworks.ai/inference/v1"),
+ ("github", "https://models.inference.ai.azure.com"),
("groq", "https://api.groq.com/openai/v1"),
("jina", "https://api.jina.ai/v1"),
("lingyiwanwu", "https://api.lingyiwanwu.com/v1"),