Models API¶
The models module provides unified interfaces for various LLM providers.
Base Class¶
Model¶
- class hivetracered.models.base_model.Model[source]¶
Bases:
ABCAbstract base class for language model implementations. Defines the standard interface for interacting with various LLM providers, supporting both synchronous and asynchronous operations for single requests and batches.
- get_params()[source]¶
Get the parameters of the model.
- Return type:
- Returns:
Dictionary containing the model’s configuration parameters
Model Implementations¶
OpenAI Models¶
- class hivetracered.models.openai_model.OpenAIModel(model='gpt-4.1-nano', base_url='https://api.openai.com/v1', max_concurrency=None, batch_size=None, rpm=300, api_key=None, max_retries=3, **kwargs)[source]¶
Bases:
LangchainModelOpenAI-compatible language model implementation using the LangChain integration. Provides a standardized interface to OpenAI’s API (or any OpenAI-compatible endpoint) with rate limiting support and both synchronous and asynchronous processing capabilities.
- __init__(model='gpt-4.1-nano', base_url='https://api.openai.com/v1', max_concurrency=None, batch_size=None, rpm=300, api_key=None, max_retries=3, **kwargs)[source]¶
Initialize the OpenAI model client with the specified configuration.
- Parameters:
model (
str) – Model identifier (e.g., “gpt-4”, “gpt-3.5-turbo”, or any model name for compatible APIs)base_url (
str) – API base URL (default: “https://api.openai.com/v1”). Override for OpenAI-compatible endpoints.max_concurrency (
int|None) – Maximum number of concurrent requests (replaces batch_size)batch_size (
int|None) – (Deprecated) Use max_concurrency instead. Will be removed in v2.0.0rpm (
int) – Rate limit in requests per minuteapi_key (
str|None) – API key; defaults to OPENAI_API_KEY env varmax_retries (
int) – Maximum number of retry attempts on transient errors (default: 3)**kwargs – Additional parameters to pass to the ChatOpenAI constructor
GigaChat Models¶
- class hivetracered.models.gigachat_model.GigaChatModel(model='GigaChat', max_concurrency=None, batch_size=None, scope=None, credentials=None, verify_ssl_certs=False, max_retries=3, **kwargs)[source]¶
Bases:
LangchainModelGigaChat language model implementation using LangChain integration. Provides standardized access to Sber’s GigaChat models with support for both synchronous and asynchronous request processing.
- __init__(model='GigaChat', max_concurrency=None, batch_size=None, scope=None, credentials=None, verify_ssl_certs=False, max_retries=3, **kwargs)[source]¶
Initialize the GigaChat model client with the specified configuration.
- Parameters:
model (
str) – GigaChat model variant (e.g., “GigaChat”, “GigaChat-Pro”)max_concurrency (
int|None) – Maximum number of concurrent requests (replaces batch_size)batch_size (
int|None) – (Deprecated) Use max_concurrency instead. Will be removed in v2.0.0scope (
str|None) – API scope for authorization (from env or explicit)credentials (
str|None) – API credentials for authentication (from env or explicit)verify_ssl_certs (
bool) – Whether to verify SSL certificates for API connectionsmax_retries (
int) – Maximum number of retry attempts on transient errors (default: 3)**kwargs – Additional parameters for model configuration: - profanity_check: Whether to enable profanity filtering - temperature: Sampling temperature (lower = more deterministic) - max_tokens: Maximum tokens in generated responses - top_p: Top-p sampling parameter for response diversity
Yandex Models¶
Google Gemini Models¶
Sber Cloud Models¶
OpenRouter Models¶
Web-Based Models (Browser Automation)¶
Web Model Base Class¶
Mistral Web Model¶
Utilities¶
Web Action Recorder¶
See Also¶
Model Integration - Usage guide and examples
Web-Based Models - Web-based models and action recorder guide