Skip to content
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

feat(oci): support OCI images and Ollama models #2628

Merged
merged 6 commits into from
Jun 22, 2024
Merged

feat(oci): support OCI images and Ollama models #2628

merged 6 commits into from
Jun 22, 2024

Conversation

mudler
Copy link
Owner

@mudler mudler commented Jun 21, 2024

Description

This PR fixes #2527
This PR fixes #1028

Now models URL can be specified also as oci:// or ollama:// prefix. Note that when oci:// is used, it will default to unpack the image content to the model path, so the container have to be a naked one (e.g. a FROM scratch built with docker). When using ollama://, it can be used as for e.g. ollama://llama3 or ollama://gemma:2b and so on so forth.

My plan is to further make the installation more flexible in a way that local-ai models install ... can be used directly with URL/oci/ollama.

How it works

Models URLs can be specified as usual, in the YAML config file for example:

parameters:
  model: ollama://...

or directly start the ollama model:

local-ai run ollama://gemma:2b

Alternatively, the model can be pre-populated with local-ai models install too:

local-ai models install ollama://gemma:2b

For OCI images, same applies but the prefix is oci://. To build a container image which works in this way, you must have a Dockerfile like this:

FROM scratch
COPY ./my_gguf_file.gguf /

Push the image in some registry and reference it.

Notes for Reviewers

It also includes a small nuances in fixing watcher message that displays always as an error 🤷

Signed commits

  • Yes, I signed my commits.

pkg/oci/blob.go Dismissed Show dismissed Hide dismissed
Copy link

netlify bot commented Jun 21, 2024

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 8952511
🔍 Latest deploy log https://app.netlify.com/sites/localai/deploys/6675e6bf725617000820224b
😎 Deploy Preview https://deploy-preview-2628--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Fixes: #2527
Fixes: #1028

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler changed the title feat(oci): support OCI images feat(oci): support OCI images and Ollama models Jun 21, 2024
@mudler mudler added the enhancement New feature or request label Jun 21, 2024
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler merged commit f569237 into master Jun 22, 2024
37 of 38 checks passed
@mudler mudler deleted the oci branch June 22, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support models from OCI registry Ollama support
1 participant