---
title: "AI-Powered Testing: Using Docker Model Runner with Microcks for Dynamic Mock APIs"
description: "Microcks' AI Copilot can generate varied, realistic mock API responses using a local LLM served by Docker Model Runner through its OpenAI-compatible endpoint."
url: "https://swe.quest/articles/ai-powered-testing-using-docker-model-runner-with-microcks-for-dynamic-mock-apis-5407790a30e64f9c"
canonical: "https://www.docker.com/blog/ai-powered-mock-apis-for-testing-with-docker-and-microcks/"
source: "Docker"
published: "2025-07-14"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["testing","llms","containers","developer-tools"]
---

# AI-Powered Testing: Using Docker Model Runner with Microcks for Dynamic Mock APIs

A post on [Docker](https://swe.quest/sources/docker.md), published 2025-07-14, 4 min read, How-to. Original: [https://www.docker.com/blog/ai-powered-mock-apis-for-testing-with-docker-and-microcks/](https://www.docker.com/blog/ai-powered-mock-apis-for-testing-with-docker-and-microcks/)

## Summary

Microcks' AI Copilot can generate varied, realistic mock API responses using a local LLM served by Docker Model Runner through its OpenAI-compatible endpoint. The setup pulls a quantized Qwen3 8B model, points Microcks' application.properties at model-runner.docker.internal so containers talk to the runner directly, enables the copilot feature flag, and runs Microcks via Docker Compose. Generated samples can be added to mocked operations and exercised with curl, and declaring the model in compose.yml makes the test setup reproducible.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- Docker Compose ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- OpenAPI specifications
- API mocking

## Keywords

Docker Model Runner, Microcks, Docker Compose, Qwen3, OpenAPI, llama.cpp

## Related posts

- [Run Gemma 3 with Docker Model Runner: Fully Local GenAI Developer Experience](https://swe.quest/articles/run-gemma-3-with-docker-model-runner-fully-local-genai-developer-experience-c005339b3915484f.md): Docker · 2025-04-09 · Medium · 7 min read · LLMs, Inference & serving, Containers, JavaScript
  Docker Model Runner (in Docker Desktop for macOS 4.40.0+) exposes an OpenAI-compatible API on localhost, so Gemma 3 can be pulled with \`docker model pull ai/gemma3\` and called through the standard OpenAI SDK by pointing baseURL at http://localhost:12434/engines/v1.
- [How to Build, Run, and Package AI Models Locally with Docker Model Runner](https://swe.quest/articles/how-to-build-run-and-package-ai-models-locally-with-docker-model-runner-acbc6d65548e5373.md): Docker · 2025-06-12 · Medium · 6 min read · Inference & serving, LLMs, Containers, Developer tools
  Docker Model Runner, enabled as a beta feature in Docker Desktop 4.40+, pulls GGUF-format LLMs from Docker Hub or Hugging Face and runs them locally via the \`docker model\` CLI or an OpenAI-compatible HTTP endpoint on localhost.
- [Run, Test, and Evaluate Models and MCP Locally with Docker + Promptfoo](https://swe.quest/articles/run-test-and-evaluate-models-and-mcp-locally-with-docker-promptfoo-ad1578ad40c09850.md): Docker · 2025-09-25 · Medium · 7 min read · Evaluation, AI agents, LLMs, AI safety, Containers
  Promptfoo, Docker Model Runner and Docker MCP Toolkit can be combined to evaluate LLM apps entirely on a dev machine.
- [Run LLMs Locally with Docker: A Quickstart Guide to Model Runner](https://swe.quest/articles/run-llms-locally-with-docker-a-quickstart-guide-to-model-runner-ccfbbb71db5d1485.md): Docker · 2025-04-04 · Medium · 5 min read · Inference & serving, LLMs, Containers, Developer tools
  Docker Model Runner, in beta with Docker Desktop 4.40 on Apple silicon, pulls LLMs packaged as OCI artifacts and serves them through an OpenAI-compatible API backed by llama.cpp.
- [Build a GenAI App With Java Using Spring AI and Docker Model Runner](https://swe.quest/articles/build-a-genai-app-with-java-using-spring-ai-and-docker-model-runner-2e0c221c42a705e5.md): Docker · 2025-07-11 · Medium · 11 min read · RAG & retrieval, Java & JVM, Testing, LLMs, Observability
  A Spring Boot GenAI app can run entirely on local models by pointing Spring AI's OpenAI module at Docker Model Runner's OpenAI-compatible endpoint, using llama3.1 for chat and mxbai-embed-large for embeddings.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
