Management Configuration

Configuration schema for resource management settings including GPU thresholds

Resource Management Schema

This schema defines configuration options for resource usage thresholds and conflict detection. It works with the cjm-fasthtml-settings library for automatic UI generation.

# Example: Accessing schema properties
print(f"Schema name: {RESOURCE_MANAGEMENT_SCHEMA['name']}")
print(f"Schema title: {RESOURCE_MANAGEMENT_SCHEMA['title']}")
print(f"\nDefault settings:")
print(f"  GPU threshold: {RESOURCE_MANAGEMENT_SCHEMA['properties']['gpu_memory_threshold_percent']['default']}%")
print(f"  Auto-unload: {RESOURCE_MANAGEMENT_SCHEMA['properties']['enable_auto_unload']['default']}")
print(f"  Auto-reload: {RESOURCE_MANAGEMENT_SCHEMA['properties']['enable_auto_reload']['default']}")
Schema name: resource-management
Schema title: Resource Management Configuration

Default settings:
  GPU threshold: 45.0%
  Auto-unload: True
  Auto-reload: True

GPU Memory Threshold

The gpu_memory_threshold_percent setting determines what percentage of GPU memory usage by an external process is considered a conflict. This helps filter out processes that are just using trivial amounts of GPU memory.

For example, with a threshold of 45%: - A Chrome tab using 100MB of a 24GB GPU (0.4%) → Not a conflict - A game using 12GB of a 24GB GPU (50%) → Conflict detected

Auto-Unload and Auto-Reload

These boolean settings control automatic plugin management:

  • Auto-Unload: When enabled, switching to a different plugin automatically unloads the previously loaded plugin to free GPU memory
  • Auto-Reload: When enabled, configuration changes automatically reload the plugin with the new settings