Test ollama service with model tags instead of a query#61
Merged
srijanpatel merged 1 commit intoPySpur-Dev:mainfrom Dec 24, 2024
Merged
Test ollama service with model tags instead of a query#61srijanpatel merged 1 commit intoPySpur-Dev:mainfrom
srijanpatel merged 1 commit intoPySpur-Dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
👍 Looks good to me! Reviewed everything up to 254073b in 9 seconds
More details
- Looked at
23lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1drafted comments based on config settings.
1. backend/test_ollama.sh:26
- Draft comment:
Consider adding anelseblock to handle the case whereOLLAMA_BASE_URLis not set, providing feedback to the user. - Reason this comment was not posted:
Confidence changes required:50%
The current implementation does not handle the case where OLLAMA_BASE_URL is not set. It should provide feedback to the user in such cases.
Workflow ID: wflow_8oNXOe49tIV8vl7S
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
Collaborator
|
Nice catch! Thanks for the PR @simonwu53 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original script initiate a chat completion query to ollama every time when the backend entry point starts and
$OLLAMA_BASE_URLhas been set. This is not efficient and has two major drawbacks. First, some users do not use "llama2" because it's relatively weak and obsolete, so ollama has to download the model first and then complete the query, which needs additional disk space for just testing the connection. Second, even with this simple query, ollama has to load the model to memory, initialize the model, then run the query, which cost both time and power.My modification is simple. In order to test the connection, we could just query available models from ollama. This query can be instantly finished without generating any chat response, thus expediting the launching speed.
Important
Modify
test_ollama.shto test Ollama connection by fetching model list instead of initiating a chat query.test_ollama.shfrom initiating a chat completion query to fetching the model list from Ollama.This description was created by
for 254073b. It will automatically update as commits are pushed.