Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
interface_factory.cpp File Reference

InferenceInterface factory — bridges orchestrator to C callbacks. More...

#include <entropic/inference/interface_factory.h>
#include <entropic/inference/orchestrator.h>
#include <entropic/types/config.h>
#include <entropic/types/message.h>
#include <nlohmann/json.hpp>
#include <atomic>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
Include dependency graph for interface_factory.cpp:

Go to the source code of this file.

Classes

struct  entropic::InterfaceContext
 Holds orchestrator + tier for C callback user_data. More...
 

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Functions

static std::vector< Messageentropic::parse_msgs (const char *json_str)
 Parse JSON message array into Message vector.
 
static GenerationParams entropic::parse_params (const char *json_str)
 Parse generation params from JSON string.
 
static std::string entropic::extract_tier (const char *json_str, const std::string &default_tier)
 Extract tier name from params JSON, falling back to default.
 
static char * entropic::dup (const std::string &s)
 Heap-allocate a C string copy.
 
static int entropic::iface_generate (const char *msgs_json, const char *params_json, char **result_json, void *user_data)
 Generate via orchestrator.
 
static int entropic::iface_generate_stream (const char *msgs_json, const char *params_json, void(*on_token)(const char *, size_t, void *), void *token_ud, int *cancel, void *user_data)
 Streaming generate via orchestrator.
 
static int entropic::iface_route (const char *msgs_json, char **result_json, void *user_data)
 Route messages to tier via orchestrator.
 
static int entropic::iface_complete (const char *prompt, const char *params_json, char **result_json, void *user_data)
 Raw text completion via orchestrator.
 
static int entropic::iface_parse_tool_calls (const char *raw, char **cleaned, char **tool_calls_json, void *user_data)
 Parse tool calls from raw model output via adapter.
 
static int entropic::iface_is_complete (const char *, const char *tool_calls_json, void *)
 Check if response is complete (no pending tool calls).
 
InferenceInterface entropic::build_orchestrator_interface (ModelOrchestrator *orchestrator, const std::string &default_tier, InterfaceContext **out_context)
 Build an InferenceInterface wired to an orchestrator.
 
void entropic::destroy_orchestrator_interface (InterfaceContext *context)
 Free a context returned by build_orchestrator_interface().
 

Detailed Description

InferenceInterface factory — bridges orchestrator to C callbacks.

Version
2.0.1

Definition in file interface_factory.cpp.