-
Notifications
You must be signed in to change notification settings - Fork 1.2k
local llm #357
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?
local llm #357
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 |
---|---|---|
|
@@ -70,6 +70,9 @@ | |
}, | ||
"o4-mini": { | ||
"temperature": 1.0 | ||
}, | ||
"claude-3.7-sonnet": { | ||
"temperature": 1.0 | ||
} | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -178,7 +178,7 @@ def __init__( | |||||
self._api_key = api_key | ||||||
self._env_api_key_name = env_api_key_name | ||||||
self._env_base_url_name = env_base_url_name | ||||||
self.base_url = base_url or os.getenv(self._env_base_url_name, "https://api.openai.com/v1") | ||||||
self.base_url = base_url or os.getenv(self._env_base_url_name, "http://10.239.142.219:8012/") | ||||||
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. Hardcoding a private IP address as a default value is a critical issue. It makes the application non-portable, difficult to configure for other developers or deployment environments, and leaks internal network details. It's much better to use a generic, safe default like
Suggested change
|
||||||
self.sync_client = self.init_sync_client() | ||||||
self.async_client = None # only initialize if the async call is called | ||||||
self.chat_completion_parser = ( | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -459,8 +459,10 @@ async def handle_websocket_chat(websocket: WebSocket): | |||||||||||||||||||||||||||||
model_kwargs = { | ||||||||||||||||||||||||||||||
"model": request.model, | ||||||||||||||||||||||||||||||
"stream": True, | ||||||||||||||||||||||||||||||
"temperature": model_config["temperature"] | ||||||||||||||||||||||||||||||
#"temperature": model_config["temperature"] | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
if "temperature" in model_config: | ||||||||||||||||||||||||||||||
model_kwargs["temperature"] = model_config["temperature"] | ||||||||||||||||||||||||||||||
Comment on lines
459
to
+465
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. While the logic to conditionally add
Suggested change
|
||||||||||||||||||||||||||||||
# Only add top_p if it exists in the model config | ||||||||||||||||||||||||||||||
if "top_p" in model_config: | ||||||||||||||||||||||||||||||
model_kwargs["top_p"] = model_config["top_p"] | ||||||||||||||||||||||||||||||
|
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.
Manipulating
sys.path
directly is generally discouraged as it can make dependency management fragile and code harder to understand. It can lead to issues with module resolution, especially in larger projects or when deployed in different environments. A better approach is to structure your project as a proper Python package and use relative imports, or to install it in editable mode (pip install -e .
) for development. This ensures that imports are explicit and reliable.