INNER CODE UNIT · Python

_bootstrap_toml_providers_to_json

derisk-ai/OpenDerisk · packages/derisk-app/src/derisk_app/app.py:290

def _bootstrap_toml_providers_to_json(
    toml_llm: Dict[str, Any], cfg: Any
) -> bool:
    """Sync TOML providers into derisk.json config.

    TOML is the source of truth for model configuration. When TOML defines
    providers, they are always synced into derisk.json so the Web UI and
    ModelConfigCache see the latest models.

    Returns True if providers were updated, False otherwise.
    """
    if not toml_llm or not toml_llm.get("provider"):
        return False

    from derisk_core.config import ConfigManager
    from derisk_core.config.schema import (
        AgentLLMConfig,
        LLMProviderConfig,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…