LlamaLib  v2.0.5
Cross-platform library for local LLMs
Loading...
Searching...
No Matches
LLMProviderRegistry Class Reference

Registry for managing LLM provider instances. More...

#include <LLM.h>

Public Member Functions

void register_instance (LLMProvider *service)
 Register an LLM provider instance.
 
void unregister_instance (LLMProvider *service)
 Unregister an LLM provider instance.
 
std::vector< LLMProvider * > get_instances ()
 Get all registered provider instances.
 
void set_debug_level (int level)
 Set global debug level.
 
const int get_debug_level ()
 Get current debug level.
 
void set_log_callback (CharArrayFn callback)
 Set global log callback.
 
const CharArrayFn get_log_callback ()
 Get current log callback.
 

Static Public Member Functions

static void inject_registry (LLMProviderRegistry *instance)
 Inject a custom registry instance.
 
static LLMProviderRegistryinstance ()
 Get the singleton registry instance.
 

Static Public Attributes

static bool initialised = false
 Whether the registry has been initialized.
 

Detailed Description

Registry for managing LLM provider instances.

Singleton pattern implementation for centralized management of LLM provider instances, debugging, and logging configuration

Definition at line 383 of file LLM.h.

Member Function Documentation

◆ get_debug_level()

const int LLMProviderRegistry::get_debug_level ( )
inline

Get current debug level.

Returns
Current debug level

Definition at line 445 of file LLM.h.

Here is the caller graph for this function:

◆ get_instances()

std::vector< LLMProvider * > LLMProviderRegistry::get_instances ( )
inline

Get all registered provider instances.

Returns
Vector of registered provider pointers

Thread-safe access to registered instances

Definition at line 430 of file LLM.h.

Here is the caller graph for this function:

◆ get_log_callback()

const CharArrayFn LLMProviderRegistry::get_log_callback ( )
inline

Get current log callback.

Returns
Current log callback function

Definition at line 459 of file LLM.h.

Here is the caller graph for this function:

◆ inject_registry()

static void LLMProviderRegistry::inject_registry ( LLMProviderRegistry * instance)
inlinestatic

Inject a custom registry instance.

Parameters
instanceCustom registry instance to use

Allows registry instance injection when using different dynamic libraries

Definition at line 391 of file LLM.h.

Here is the caller graph for this function:

◆ instance()

static LLMProviderRegistry & LLMProviderRegistry::instance ( )
inlinestatic

Get the singleton registry instance.

Returns
Reference to the registry instance

Definition at line 399 of file LLM.h.

Here is the caller graph for this function:

◆ register_instance()

void LLMProviderRegistry::register_instance ( LLMProvider * service)
inline

Register an LLM provider instance.

Parameters
serviceProvider instance to register

Thread-safe registration of provider instances

Definition at line 412 of file LLM.h.

Here is the caller graph for this function:

◆ set_debug_level()

void LLMProviderRegistry::set_debug_level ( int level)
inline

Set global debug level.

Parameters
levelDebug verbosity level

Definition at line 438 of file LLM.h.

Here is the caller graph for this function:

◆ set_log_callback()

void LLMProviderRegistry::set_log_callback ( CharArrayFn callback)
inline

Set global log callback.

Parameters
callbackFunction to receive log messages

Definition at line 452 of file LLM.h.

Here is the caller graph for this function:

◆ unregister_instance()

void LLMProviderRegistry::unregister_instance ( LLMProvider * service)
inline

Unregister an LLM provider instance.

Parameters
serviceProvider instance to unregister

Thread-safe removal of provider instances

Definition at line 421 of file LLM.h.

Here is the caller graph for this function:

Member Data Documentation

◆ initialised

bool LLMProviderRegistry::initialised = false
static

Whether the registry has been initialized.

Definition at line 386 of file LLM.h.


The documentation for this class was generated from the following files: