-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: 添加对Xinference模型的支持 #528
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
base: main
Are you sure you want to change the base?
Conversation
在.env.example中添加了XINFERENCE_OPENAI_ENDPOINT和XINFERENCE_MODEL环境变量,并在src/utils/utils.py中实现了对Xinference模型的支持。新增的模型名称列表包括qwen2.5和deepseek系列模型。
lao seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mrge found 4 issues across 2 files. View them in mrge.io
@@ -30,6 +30,9 @@ UNBOUND_API_KEY= | |||
SiliconFLOW_ENDPOINT=https://api.siliconflow.cn/v1/ | |||
SiliconFLOW_API_KEY= | |||
|
|||
XINFERENCE_OPENAI_ENDPOINT=https://api.xinference.com/v1 | |||
XINFERENCE_MODEL= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing documentation for expected values for XINFERENCE_MODEL environment variable
@@ -183,6 +183,18 @@ def get_llm_model(provider: str, **kwargs): | |||
model_name=kwargs.get("model_name", "Qwen/QwQ-32B"), | |||
temperature=kwargs.get("temperature", 0.0), | |||
) | |||
elif provider == "xinference": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing entry for "xinference" in PROVIDER_DISPLAY_NAMES dictionary
src/utils/utils.py
Outdated
base_url = kwargs.get("base_url") | ||
|
||
return ChatOpenAI( | ||
model=kwargs.get("model_name", "gpt-4o"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default model for Xinference provider is set to "gpt-4o" which is not in the xinference model list
@@ -183,6 +183,18 @@ def get_llm_model(provider: str, **kwargs): | |||
model_name=kwargs.get("model_name", "Qwen/QwQ-32B"), | |||
temperature=kwargs.get("temperature", 0.0), | |||
) | |||
elif provider == "xinference": | |||
if not kwargs.get("base_url", ""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API key retrieval uses a different environment variable pattern than what's defined in .env.example
在utils.py中添加对XInference的支持,并在.env.example中添加XINFERENCE_API_KEY环境变量。这些更改使得系统能够更好地集成XInference服务。
Summary by mrge
Added support for Xinference models including Qwen2.5 and Deepseek series. This integration enables users to leverage these models through a standardized interface with configurable endpoints.
New Features
Refactors
在.env.example中添加了XINFERENCE_OPENAI_ENDPOINT和XINFERENCE_MODEL环境变量,并在src/utils/utils.py中实现了对Xinference模型的支持。新增的模型名称列表包括qwen2.5和deepseek系列模型。