mcpplibs.llmapi
importModern C++ LLM API client with openai-compatible support
import mcpplibs.llmapi;
Module name read from the upstream `export module` declaration in src/llmapi.cppm.
mcpp add mcpplibs.llmapi@0.2.8
Usage
From this repository's own test project — built and run by CI, not written for the website.
// Consuming `mcpplibs.llmapi` through the published index.
//
// Every assertion here is OFFLINE, on purpose. This is an HTTP client, and a
// test that reaches an LLM endpoint needs a key CI does not have, costs money,
// and fails for reasons that have nothing to do with the package. What a
// workspace member is for is the dependency edge: does the module import,
// does its exported surface exist and behave, does it link.
//
// The partitions exercised (:url, :types, :errors) are pure data and pure
// logic, which is exactly why they are the right ones to assert on.
import std;
import mcpplibs.llmapi;
using namespace mcpplibs;
int main() {
int failures = 0;
auto check = [&](bool ok, std::string_view what) {
if (!ok) { std::println("FAIL: {}", what); ++failures; }
};
// :url — the provider endpoints are compile-time constants, so a wrong one
// …
tests/examples/llmapi/tests/consume.cpp · project tests/examples/llmapi
Build · upstream manifest
- modules
mcpplibs.llmapi- targets
llmapi (lib)- manifest version
0.2.8- dependencies
mcpplibs- source
https://raw.githubusercontent.com/mcpplibs/llmapi/0.2.8/mcpp.toml