-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support ollama #193
Support ollama #193
Conversation
db49d51
to
05078e4
Compare
while true;do sleep 60;done" | ||
envs: | ||
- name: OLLAMA_HOST | ||
value: 0.0.0.0:8080 |
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.
OLLAMA_HOST can expose custom port
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.
great
} | ||
// replace | ||
value = strings.Replace(value, match[0], replacement, -1) | ||
} |
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.
replace instaned of override
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.
Generally LGTM, have you tested locally? Maybe we can have a e2e test because ollama can still run with CPUs.
args: | ||
- name: default | ||
flags: | ||
- "ollama serve & |
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.
We need to support readiness and liveness next, see #21, but this is ok for now.
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.
let's support probe in the future
while true;do sleep 60;done" | ||
envs: | ||
- name: OLLAMA_HOST | ||
value: 0.0.0.0:8080 |
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.
great
docs/examples/ollama/model.yaml
Outdated
spec: | ||
familyName: qwen2 | ||
source: | ||
uri: OLLAMA://qwen2:0.5b |
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.
Let's use lower case for consistency, just like http, although we'll convert to upper case for comparison in the runtime.
modelPath string | ||
modelName string | ||
protocol string | ||
bucket string |
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.
We may need to refactor this part in the future, divide the URIProvider to more specified ones, but not a hurry.
Thanks for your review, I've done multiple tests locally before committing. |
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.
Some nits.
value := flag | ||
matches := re.FindAllStringSubmatch(flag, -1) | ||
|
||
if len(matches) > 0 { |
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.
Let's refactor like this, to reduce the nested blocks.
if len(matches) == 0 {
return
}
if len(matches) > 0 { | ||
for _, match := range matches { | ||
if len(match) > 1 { | ||
// get key |
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.
Remove this comment, it's meaningless.
if !exists { | ||
return nil, fmt.Errorf("missing flag or the flag has format error: %s", flag) | ||
} | ||
// replace |
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.
Also remove this comment, I think the code is clear enough.
If you finished the work, feel free to Ping me, not to rush you, just a friendly reminder. 😄 |
Thankd for your kind reply. |
I have completed the e2e ollama test, please review the code again @kerthcet |
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.
/approve
Please squash the commits.
2d698dd
to
f0483b1
Compare
kind ping @kerthcet, I've squash the commits |
/lgtm |
/kind feature |
/approve |
What this PR does / why we need it
Support ollama
Which issue(s) this PR fixes
#91
Special notes for your reviewer
ollama run
;because needs to start first and make sure the ollama service is startedDoes this PR introduce a user-facing change?