Server

Embedded multi-threaded HTTP server (JBitServer in Server/JBitServer.hpp) implementing OpenAI-compatible /v1/chat/completions, /v1/completions, /v1/models, and /health with SSE token streaming.

class JBitServer global · Server/JBitServer.hpp · 2 members

Non-blocking background HTTP server with Bearer API key authentication, request serialization for thread-unsafe models, CORS headers, and Server-Sent Events streaming.

JBitServer(ServerRequestHandler handler, ServerOptions options = ServerOptions());
void start() / void stop() / bool running() const / uint16_t port() const / std::string url() const / void waitUntilStopped();
struct ServerOptions & ServerRequest global · Server/JBitServer.hpp · 2 members

Server binding/security options and parsed OpenAI chat/completion request payload.

std::string host = "127.0.0.1"; uint16_t port = 8080; std::string modelName = "jbit"; std::string apiKey; bool serializeRequests = true; bool allowCors = false;
Kind kind; std::vector<ChatMessage> messages; std::string prompt; bool stream; size_t maxTokens; double temperature, topP;
Free functions & typedefs1
using ServerRequestHandler = std::function<std::string(const ServerRequest &, std::ostream &tokenStream)>;