Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Docker 4 min read Case study mediumAdept

Using AI Tools to Convert a PDF into Images

An LLM agent can convert a PDF into JPEG images by planning an ImageMagick `convert` call that runs in a Docker container, so nothing needs to be installed locally. Tools are defined in Markdown prompt files, distributed through Docker Hub and pulled from nixpkgs. Rather than hand-designing interfaces for each tool, the agent loops through running the tool, capturing errors, reading the tool's own documentation and retrying. One packaging gap, a missing Ghostscript dependency, still had to be fixed by hand in the image build.

Related posts

  • Getting Started with the Labs AI Tools for Devs Docker Desktop Extension

    Docker mediumAdept

    The Labs AI Tools for Devs Docker Desktop extension runs LLM prompts against local projects. Prompts are referenced by git ref or URL, or loaded as local files. A prompt is a markdown file with system and user sections, and project context such as languages and files is injected through mustache templates. Tools the LLM can call are defined as Docker images that get bind-mounted into the project and receive a JSON payload as their first argument. Sample prompts cover Dockerfile generation, runbooks, ESLint and Pylint fixes.

  • Using an AI Assistant to Read Tool Documentation

    Docker mediumAdept

    LLM agents can learn unfamiliar command-line tools by reading their documentation and reacting to Unix error signals. Each tool is packaged as a minimal Docker image exposed through two OpenAI-style tool definitions: one runs the command, the other reads its man page. Failures surface through exit codes and stderr, which the model uses to retry, and GPT-4, Llama 3.1 and Mistral responded to those errors differently. Across roughly 90 tools, only about 60% had man pages, so the fallback chain was man, --help, -h, then bad arguments to capture stderr. Long man pages were chunked by their standard sections for RAG, with priority given to argument descriptions and usage examples.

  • How to Create Dockerfiles with GenAI

    Docker mediumAdept

    Framing Dockerfile generation as an interaction between an LLM and tools, rather than a chat where the user supplies project details, produces much better results. An assistant given analyze_project, write_files and docker_scout_tag_recommendation functions, two anchoring instructions, and Markdown best-practice prompts for NPM projects generates a three-stage Dockerfile with current slim base images and npm cache mounts, instead of an outdated single-stage node:14 file. The full transcript shows the GPT-4 assistant recovering on its own from an invalid-JSON tool error. Docker is still testing whether this approach adapts to new project types more easily than code templates.

  • A PDF is not a string

    Render mediumAdept

    Document ingestion for agents breaks because PDFs carry no structural markup, so naive text extraction scrambles multi-column layouts and tables, and frontier models lose accuracy on visual structure while returning flat text with no bounding boxes, confidence or provenance. LlamaParse splits ingestion into classification (document type plus confidence), parsing (layout-aware Markdown with OCR and preserved tables) and extraction (schema-driven JSON), so failures can be traced to a specific stage. The reference architecture on Render uses a thin Express upload service streaming progress over SSE, Render Workflows running five tasks (store, classify, parse, extract, store results), and four Postgres tables holding each intermediate output as an audit trail. Demos showed a receipt classified at 85% confidence and a 24-page bank statement fully parsed with five fields extracted.

  • Build a Recipe AI Agent with Koog and Docker

    Docker mediumAdept

    A small Kotlin AI agent built with JetBrains' Koog framework can run entirely on a local model served by Docker Model Runner, wired up through Docker Compose's agentic models feature. Compose injects the model endpoint and name as environment variables, and Koog's OpenAI-compatible client talks to the llama.cpp-based runner using the small Lucy 128k GGUF model, which runs without a GPU. When the model produces an inaccurate ratatouille recipe, the walkthrough fixes it by adding the Docker MCP Gateway over SSE to expose a DuckDuckGo search tool. The Kotlin changes are a Koog MCP tool registry and enabling the Tools capability on the model so it can call functions.

The quest for software engineering knowledge.

Look:
Layout: