Skip to content

feat: update OpenVINO to use llama.cpp backend - #4377

Open
bmahabirbu wants to merge 1 commit into
containers:mainfrom
bmahabirbu:update-openvino-llama-cpp-backend
Open

feat: update OpenVINO to use llama.cpp backend#4377
bmahabirbu wants to merge 1 commit into
containers:mainfrom
bmahabirbu:update-openvino-llama-cpp-backend

Conversation

@bmahabirbu

Copy link
Copy Markdown
Contributor

Summary

  • Switch OpenVINO inference provider from OVMS to llama.cpp backend using new container image quay.io/bmahabir/openvino:latest
  • Remove OVMS-specific code (graph.pbtxt, config-all.json generation, prePerform override)
  • Add GGML environment variables: GGML_OPENVINO_DEVICE=CPU by default, GGML_OPENVINO_DEVICE=GPU + GGML_OPENVINO_STATEFUL_EXECUTION=1 when experimental GPU is enabled

Test plan

  • Existing OpenVINO unit tests updated and passing (8/8)
  • Verify OpenVINO inference server starts with CPU device by default
  • Verify GPU env vars are set when experimental GPU is enabled
  • Verify model file mounts correctly into container

🤖 Generated with Claude Code

@bmahabirbu
bmahabirbu requested review from a team, benoitf and jeffmaury as code owners April 9, 2026 05:31
@bmahabirbu
bmahabirbu requested review from dgolovin and gastoner and removed request for a team April 9, 2026 05:31
@bmahabirbu
bmahabirbu force-pushed the update-openvino-llama-cpp-backend branch 7 times, most recently from 0020765 to 213c2d8 Compare April 9, 2026 06:59
Switch the OpenVINO inference provider from OVMS (OpenVINO Model Server)
to a llama.cpp-based backend. This simplifies the provider by removing
graph/config file generation and using direct llama-server invocation.

- Point to new container image quay.io/bmahabir/openvino:latest
- Remove OVMS-specific code: graph.pbtxt, config-all.json, prePerform
- Mount single model file instead of directory (like LlamaCppPython)
- Add GGML_OPENVINO_DEVICE=CPU by default
- Add GGML_OPENVINO_DEVICE=GPU + GGML_OPENVINO_STATEFUL_EXECUTION=1
  when experimental GPU is enabled
- Use llama-server entrypoint with env var expansion for host/port

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian <bmahabir@bu.edu>
@bmahabirbu
bmahabirbu force-pushed the update-openvino-llama-cpp-backend branch from 213c2d8 to c7c86ad Compare April 9, 2026 07:18

@gastoner gastoner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have some testing steps for this PR?
I do have a laptop with intel cpu but no dedicated GPU
But I should be able to check the env vars in the container right?

},
"openvino": {
"default": "quay.io/ramalama/openvino@sha256:e026ecbdf6ae222a193badad5b0dd2253362e366e22c8b402f5a492803b10fd5"
"default": "quay.io/bmahabir/openvino:latest"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking if we should use @sha instead ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change once ramalama adds the new upstream openvino image

I built it and pushed it to quay under my name for testing

@bmahabirbu

bmahabirbu commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@gastoner thanks for taking a look! So for testing download the unsloth llama3.2 model and use it for a recipe or a model service.

Under the hood that model has the openvino backend so it should use the new container and args!

What i do is if the gpu selection is enabled in setting ill pass it so technically you can disable it to use cpu but what ive found is the container is smart and will fall back to cpu anyways if its not available

@bmahabirbu

Copy link
Copy Markdown
Contributor Author
Screen.Recording.2026-04-09.at.3.22.08.AM.mov

@benoitf
benoitf removed their request for review April 9, 2026 13:26
},
"openvino": {
"default": "quay.io/ramalama/openvino@sha256:e026ecbdf6ae222a193badad5b0dd2253362e366e22c8b402f5a492803b10fd5"
"default": "quay.io/bmahabir/openvino:latest"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: can't merge with this image we need a release image reference using sha

if (isApplicationOptionsWithModelInference(options)) {
// if the recipe has a defined backend, we gives priority to using an inference server
if (options.recipe.backend && options.recipe.backend === options.model.backend) {
// OpenVINO uses llama.cpp backend, so treat openvino models as compatible with llama-cpp recipes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: this is hacky we need multi backend support that is another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants