INNER CODE UNIT · Python
_load_local_llm_config
bunkeriot/BunkerM · backend/app/agent-api/main.py:435
def _load_local_llm_config() -> dict:
try:
if LOCAL_LLM_CONFIG_FILE.exists():
return json.loads(LOCAL_LLM_CONFIG_FILE.read_text())
except Exception:
pass
return {"enabled": False, "url": _DEFAULT_LLM_URL, "model": ""}
def _save_local_llm_config(cfg: dict):
DATA_DIR.mkdir(parents=True, exist_ok=True)
LOCAL_LLM_CONFIG_FILE.write_text(json.dumps(cfg, indent=2))
async def _fetch_broker_context() -> str:
"""Fetch live broker data and return a formatted context string for the system prompt."""
lines: list[str] = []
api_key = API_KEY