Skip to content

Commit

Permalink
deepseek chat
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaawwa committed May 7, 2024
1 parent eb52774 commit 979ab99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions", "http://localhost:11434/api/chat": "在这里填写您ollama的URL"}
API_URL_REDIRECT = {}


API_KEY_REDIRECT = {}
# 多线程函数插件中,默认允许多少路线程同时访问OpenAI。Free trial users的限制是每分钟3次,Pay-as-you-go users的限制是每分钟3500次
# 一言以蔽之:免费(5刀)用户填3,OpenAI绑了信用卡的用户可以填 16 或者更高。提高限制请查询:https://platform.openai.com/docs/guides/rate-limits/overview
DEFAULT_WORKER_NUM = 3
Expand Down
9 changes: 9 additions & 0 deletions request_llms/bridge_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ def decode(self, *args, **kwargs):
# -=-=-=-=-=-=- 以下这部分是最早加入的最稳定的模型 -=-=-=-=-=-=-
model_info = {
# OhMyGPT 兼容接口
"deepseek-chat": { # 16k
"can_multi_thread": True,
"fn_with_ui": chatgpt_ui,
"fn_without_ui": chatgpt_noui,
"endpoint": openai_endpoint,
"max_token": 32768,
"tokenizer": tokenizer_gpt35,
"token_cnt": get_token_num_gpt35,
},
"claude-3-opus-patch": { # 16k
"fn_with_ui": chatgpt_ui,
"fn_without_ui": chatgpt_noui,
Expand Down
3 changes: 3 additions & 0 deletions shared_utils/key_pattern_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def what_keys(keys):


def select_api_key(keys, llm_model):
API_KEY_REDIRECT = get_conf('API_KEY_REDIRECT')
if llm_model in API_KEY_REDIRECT:
return API_KEY_REDIRECT[llm_model]
import random
avail_key_list = []
key_list = keys.split(',')
Expand Down

0 comments on commit 979ab99

Please sign in to comment.