Config
Configuration module for Focoos AI SDK.
This module defines the configuration settings for the Focoos AI SDK, including API credentials, logging levels, default endpoints, and runtime preferences.
Classes:
Name | Description |
---|---|
FocoosConfig |
Pydantic settings class for Focoos SDK configuration. |
Constants
LogLevel: Type definition for supported logging levels. FOCOOS_CONFIG: Global configuration instance.
FocoosConfig
#
Bases: BaseSettings
Configuration settings for the Focoos AI SDK.
This class uses pydantic_settings to manage configuration values, supporting environment variable overrides and validation. All attributes can be configured via environment variables with the same name.
Attributes:
Name | Type | Description |
---|---|---|
focoos_api_key |
Optional[str]
|
API key for authenticating with Focoos services. Defaults to None. |
focoos_log_level |
LogLevel
|
Logging level for the SDK. Defaults to "DEBUG". |
default_host_url |
str
|
Default API endpoint URL. Defaults to the production API URL. |
runtime_type |
RuntimeTypes
|
Default runtime type for model inference. Defaults to ONNX_CUDA32 for NVIDIA GPU acceleration. |
warmup_iter |
int
|
Number of warmup iterations for model initialization. Defaults to 2. |
Example
Setting configuration via environment variables in bash:
1 2 3 4 5 6 7 8 9 |
|
Source code in focoos/config.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|