Skip to main content

OpenAIServer.h File

Multi-model OpenAI-compatible HTTP server for NEAT GenAI models. More...

Included Headers

#include "genai/GenAITypes.h" #include <cstdint> #include <filesystem> #include <memory> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacegenai

Classes Index

structOpenAIServerOptions
classOpenAIServer

Description

Multi-model OpenAI-compatible HTTP server for NEAT GenAI models.

File Listing

The file content with the documentation metadata removed is:

1
5#pragma once
6
7#include "genai/GenAITypes.h"
8
9#include <cstdint>
10#include <filesystem>
11#include <memory>
12#include <string>
13#include <vector>
14
15namespace simaai::neat::genai {
16
17class GenAIModel;
18
20 std::string host = "0.0.0.0";
21 std::uint16_t port = 9998;
22};
23
25public:
26 explicit OpenAIServer(OpenAIServerOptions options = {});
28
30 OpenAIServer& operator=(OpenAIServer&&) noexcept;
31
32 OpenAIServer(const OpenAIServer&) = delete;
33 OpenAIServer& operator=(const OpenAIServer&) = delete;
34
35 std::string add_model(std::filesystem::path model_dir);
36 std::string add_model(std::filesystem::path model_dir, std::string served_name);
37 void add_model(std::string served_name, std::shared_ptr<GenAIModel> model);
38 bool remove_model(const std::string& served_name);
39 std::vector<std::string> model_names() const;
40
41 void serve();
42 void start();
43 void stop();
44
45private:
46 struct Impl;
47 std::unique_ptr<Impl> impl_;
48};
49
50} // namespace simaai::neat::genai

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.