-
Notifications
You must be signed in to change notification settings - Fork 2.1k
1.Add Local Models #531
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?
1.Add Local Models #531
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,8 @@ | |
"google": "Google", | ||
"alibaba": "Alibaba", | ||
"moonshot": "MoonShot", | ||
"unbound": "Unbound AI" | ||
"unbound": "Unbound AI", | ||
"local": "Local Model" | ||
} | ||
|
||
|
||
|
@@ -180,7 +181,22 @@ def get_llm_model(provider: str, **kwargs): | |
return ChatOpenAI( | ||
api_key=api_key, | ||
base_url=base_url, | ||
model_name=kwargs.get("model_name", "Qwen/QwQ-32B"), | ||
model=kwargs.get("model_name", "Qwen/QwQ-32B"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parameter name changed from model_name to model for the siliconflow provider, indicating a bug fix. This suggests there may be other inconsistencies in other providers. |
||
temperature=kwargs.get("temperature", 0.0), | ||
) | ||
elif provider == "local": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Local provider implementation duplicates API key and base_url extraction logic |
||
if not kwargs.get("api_key", ""): | ||
api_key = os.getenv("LOCAL_API_KEY", "") | ||
else: | ||
api_key = kwargs.get("api_key") | ||
if not kwargs.get("base_url", ""): | ||
base_url = os.getenv("LOCAL_ENDPOINT", "") | ||
else: | ||
base_url = kwargs.get("base_url") | ||
return ChatOpenAI( | ||
api_key=api_key, | ||
base_url=base_url, | ||
model=kwargs.get("model_name", ""), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty string as default model name for local provider could cause API errors if the model name is required |
||
temperature=kwargs.get("temperature", 0.0), | ||
) | ||
else: | ||
|
@@ -201,6 +217,7 @@ def get_llm_model(provider: str, **kwargs): | |
"alibaba": ["qwen-plus", "qwen-max", "qwen-turbo", "qwen-long"], | ||
"moonshot": ["moonshot-v1-32k-vision-preview", "moonshot-v1-8k-vision-preview"], | ||
"unbound": ["gemini-2.0-flash", "gpt-4o-mini", "gpt-4o", "gpt-4.5-preview"], | ||
"local": ["local-model"], | ||
"siliconflow": [ | ||
"deepseek-ai/DeepSeek-R1", | ||
"deepseek-ai/DeepSeek-V3", | ||
|
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 comment explaining the purpose of removing tags from the AI response