Table of Contents

External agents (llmcpp)

External agents run generation in a separate program speaking llmcpp's public protocol. The numbered example launches a Python adapter for a local model server:

$ llmc++ \
    -fllm-agent='python3 examples/python/18_agent.py' \
    -fllm-agent-config=examples/json/18_config.json \
    examples/18_custom_agent.cpp

Run this from the repository root with the example's model service configured. The compiler sends an llm/generate request, and the agent calls compiler tools to inspect, check, and submit a body.

Standard input and output carry newline-delimited JSON-RPC. Diagnostics belong on standard error so they do not corrupt the protocol. Returning code as plain output is not submission. The compiler still owns deadlines and budgets, and an agent must honor requested settings or report that it cannot.

Source: 18_custom_agent.cpp.