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.
OLLAMA_HOST can expose custom port
| } | ||
| // replace | ||
| value = strings.Replace(value, match[0], replacement, -1) | ||
| } |
There was a problem hiding this comment.
replace instaned of override
kerthcet
left a comment
There was a problem hiding this comment.
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.
We need to support readiness and liveness next, see #21, but this is ok for now.
There was a problem hiding this comment.
let's support probe in the future
| while true;do sleep 60;done" | ||
| envs: | ||
| - name: OLLAMA_HOST | ||
| value: 0.0.0.0:8080 |
| spec: | ||
| familyName: qwen2 | ||
| source: | ||
| uri: OLLAMA://qwen2:0.5b No newline at end of file |
There was a problem hiding this comment.
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.
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. |
| value := flag | ||
| matches := re.FindAllStringSubmatch(flag, -1) | ||
|
|
||
| if len(matches) > 0 { |
There was a problem hiding this comment.
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.
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.
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 |
kerthcet
left a comment
There was a problem hiding this comment.
/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?