[GH-ISSUE #4196] Mocked model for integration testing Ollama into other tools and environments #2610

Open
opened 2026-04-12 12:57:43 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @bauersimon on GitHub (May 6, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4196

We are looking for a model or a functionality of Ollama that allows us to mock requests and responses without changing the Ollama binary. Basically we want to define a map of requests to responses, e.g. when "Foo" comes in as a request, we want to define that "Bar" should be returned by the model.

This allows us to do integration testing of Ollama for the DevQualityEval (an evaluation benchmark to evolve the quality of code generation). We need deterministic mocking definition, to allow for deterministic testing.

Originally created by @bauersimon on GitHub (May 6, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4196 We are looking for a model or a functionality of Ollama that allows us to mock requests and responses without changing the Ollama binary. Basically we want to define a map of requests to responses, e.g. when "Foo" comes in as a request, we want to define that "Bar" should be returned by the model. This allows us to do integration testing of Ollama for the [DevQualityEval](https://github.com/symflower/eval-dev-quality) (an evaluation benchmark to evolve the quality of code generation). We need deterministic mocking definition, to allow for deterministic testing.
GiteaMirror added the feature request label 2026-04-12 12:57:43 -05:00
Author
Owner

@alexrecuenco commented on GitHub (Oct 21, 2024):

I was also looking to do some basic integration testing, and I can't figure out what is the best approach.

@bauersimon, did you find any simple integrated way to do it? I don't know if the "simplest way" it is going to be create our own "model" that simply echoes back the tokens it receives

<!-- gh-comment-id:2426510123 --> @alexrecuenco commented on GitHub (Oct 21, 2024): I was also looking to do some basic integration testing, and I can't figure out what is the best approach. @bauersimon, did you find any simple integrated way to do it? I don't know if the "simplest way" it is going to be create our own "model" that simply echoes back the tokens it receives
Author
Owner

@bauersimon commented on GitHub (Oct 24, 2024):

We still just use qwen:0.5b and assert that some text is returned. Better than nothing but not ideal.

<!-- gh-comment-id:2435028055 --> @bauersimon commented on GitHub (Oct 24, 2024): We still just use `qwen:0.5b` and assert that some text is returned. Better than nothing but not ideal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2610