API Reference
Epochly API Reference: Configuration API
Programmatic configuration API for setting enhancement levels, telemetry, and optimization parameters.
Programmatic configuration interface for Epochly.
configure()
Configure Epochly settings programmatically.
Signature
epochly.configure(**kwargs) -> None
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
enhancement_level | int | 0 | Enhancement level (0-4) |
mode | str | 'balanced' | Operating mode: 'off', 'monitor', 'conservative', 'balanced', 'aggressive' |
max_workers | int | 8 | Maximum worker count (1-256) |
telemetry | bool | True | Enable anonymous telemetry |
jit_enabled | bool | True | Enable JIT compilation |
cache_size | int | 512 | Cache size in MB (0-10240) |
log_level | str | 'INFO' | Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL |
auto_optimize | bool | True | Enable automatic optimization |
memory_limit | int | 4096 | Memory limit in MB (100-102400) |
profile_enabled | bool | False | Enable profiling |
gpu_enabled | bool | True | Enable GPU acceleration |
Note: Defaults shown are CONFIG_SCHEMA defaults applied at initialization. When calling configure(), omitting a parameter leaves its current value unchanged. The log_level CONFIG_SCHEMA default is 'INFO', but the logger initializes with 'WARNING' before any configure() call.
Example
import epochlyepochly.configure(enhancement_level=3,mode='balanced',max_workers=8,jit_enabled=True,gpu_enabled=True)
get_status()
Get current optimization status.
Signature
epochly.get_status() -> dict
Returns
| Key | Type | Description |
|---|---|---|
enabled | bool | Whether Epochly is enabled |
enhancement_level | int | Current level (0-4) |
mode | str | Current mode |
jit_available | bool | JIT compilation available |
worker_count | int | Number of workers |
gpu_available | bool | GPU acceleration available |
license_tier | str | License tier |
Example
import epochlystatus = epochly.get_status()print(f"Enhancement level: {status['enhancement_level']}")print(f"Workers: {status.get('worker_count', 0)}")print(f"Mode: {status.get('mode', 'balanced')}")
get_config()
Get current configuration.
Signature
epochly.get_config() -> dict
Returns
Dictionary containing all configuration settings.
Example
import epochlyconfig = epochly.get_config()print(f"Mode: {config['mode']}")print(f"Max workers: {config['max_workers']}")
set_level()
Set the enhancement level.
Signature
epochly.set_level(level: int) -> None
Parameters
| Parameter | Type | Description |
|---|---|---|
level | int | Enhancement level (0-4) |
Levels
| Level | Name | Description |
|---|---|---|
| 0 | Monitor | Monitoring only |
| 1 | Threading | Thread pool optimization |
| 2 | JIT | JIT compilation |
| 3 | Multicore | Full parallelism |
| 4 | GPU | GPU acceleration |
Example
import epochlyepochly.set_level(3) # Enable full optimization
get_level()
Get the current enhancement level.
Signature
epochly.get_level() -> int
Returns
Current enhancement level (0-4).
Example
import epochlylevel = epochly.get_level()print(f"Current level: {level}")
is_enabled()
Check if Epochly is enabled.
Signature
epochly.is_enabled() -> bool
Returns
True if Epochly is enabled, False otherwise.
Example
import epochlyif epochly.is_enabled():print("Epochly is active")else:print("Epochly is disabled")
get_metrics()
Get performance metrics.
Signature
epochly.get_metrics() -> dict
Returns
| Key | Type | Description |
|---|---|---|
total_calls | int | Total function calls |
total_time_ms | float | Total execution time |
mean_time_ms | float | Average execution time |
memory_peak_mb | float | Peak memory usage |
cpu_utilization_percent | float | CPU utilization |
Example
import epochlymetrics = epochly.get_metrics()print(f"Total calls: {metrics.get('total_calls')}")print(f"Mean time: {metrics.get('mean_time_ms')} ms")
get_license_info()
Get license information.
Signature
epochly.get_license_info() -> dict
Returns
| Key | Type | Description |
|---|---|---|
tier | str | License tier |
valid | bool | License validity |
features | list | Available features |
expiration | str | Expiration date (if applicable) |
Example
import epochlylicense_info = epochly.get_license_info()print(f"Tier: {license_info['tier']}")print(f"Features: {license_info['features']}")
check_feature()
Check if a feature is available.
Signature
epochly.check_feature(feature: str) -> bool
Parameters
| Parameter | Type | Description |
|---|---|---|
feature | str | Feature name to check |
Available Features
| Feature | Description |
|---|---|
'jit_compilation' | JIT compilation support |
'multicore' | Multicore parallelism |
'gpu_acceleration' | GPU acceleration |
'sub_interpreters' | Sub-interpreter support |
'shared_memory' | Shared memory support |
Example
import epochlyif epochly.check_feature('gpu_acceleration'):print("GPU acceleration available")epochly.set_level(4)else:print("Using CPU optimization")epochly.set_level(3)