Site Tools


llmcpp-backend-test-servers

Table of Contents

Backend test servers (llmcpp)

Backend test servers provide controlled model-API responses for native-client tests. The OpenAI fixture starts locally and exposes request history:

llmcpp::test::TestFakeOpenAIServer server;
CHECK(server.base_url().find("http://127.0.0.1:") == 0);
CHECK(server.calls() == 0);
CHECK(server.requests().empty());
CHECK(server.problem().empty());

The test checks that a new fixture has a loopback endpoint, no calls, no captured requests, and no reported problem. Integration tests pass that endpoint to the native client, then verify its tool exchange and submitted request contents.

This differs from a mock agent: the server speaks a provider API format, while a mock agent speaks the compiler's external-agent protocol. Both make selected scenarios reproducible without remote service credentials or nondeterministic model choices.

Source: test_unit_test_fake_openai_server.cpp.

llmcpp-backend-test-servers.md · Last modified: by 127.0.0.1