Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ssseVennn
Copy link

@ssseVennn ssseVennn commented Apr 14, 2025

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

  • Added Xinference provider implementation in the LLM model utility function
  • Added environment variables for Xinference OpenAI endpoint and model selection
  • Added support for 18 new models including Qwen2.5 and Deepseek series variants

Refactors

  • Extended the model selection system to include Xinference models alongside existing providers

在.env.example中添加了XINFERENCE_OPENAI_ENDPOINT和XINFERENCE_MODEL环境变量,并在src/utils/utils.py中实现了对Xinference模型的支持。新增的模型名称列表包括qwen2.5和deepseek系列模型。

在.env.example中添加了XINFERENCE_OPENAI_ENDPOINT和XINFERENCE_MODEL环境变量,并在src/utils/utils.py中实现了对Xinference模型的支持。新增的模型名称列表包括qwen2.5和deepseek系列模型。
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

Copy link

@mrge-io mrge-io bot left a 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=
Copy link

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":
Copy link

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

base_url = kwargs.get("base_url")

return ChatOpenAI(
model=kwargs.get("model_name", "gpt-4o"),
Copy link

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", ""):
Copy link

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服务。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants