Skip to content
Pranab Shukla edited this page Jun 5, 2026 · 5 revisions

Network ML

A simple, modern C++ library for REST API requests and LLM chat (local via Ollama, or cloud providers), built on libcurl.

#include "networkml.h"
using namespace ML;

Requests req;
Response r = req.get("https://api.example.com/data");
if (r.ok()) std::cout << r.status << "\n" << r.body;

Chat chat(Provider::Ollama, "llama3.2:1b");
std::cout << chat.ask("Explain RAII in one sentence.");

Documentation

  • Getting Started: requirements, building with CMake + vcpkg, prebuilt binaries
  • Requests: the HTTP client (verbs, Response, auth, downloads, uploads, retries)
  • Chat: the LLM client (providers, streaming, reasoning, history)
  • File: cross-platform file and folder utilities

Features at a glance

  • HTTP verbs get / post / put / patch / del / head, each returning a rich Response (status, body, response headers)
  • Auth helpers, URL encoding, file download/upload, and opt-in retries with backoff
  • Chat across Ollama, Groq, OpenRouter, DeepSeek, OpenAI, Anthropic behind one API
  • Token streaming, reasoning-token support, conversation memory, save/load history
  • Cross-platform file utilities built on std::filesystem
  • Built on statically-linked libcurl (HTTPS via Schannel on Windows), C++17

License

MIT. See the LICENSE.

Network ML

Related: File ML (ML::File)

Clone this wiki locally