register_backend (backends/registry.py)

DeepZero · src/deepzero/engine/backends/registry.py · python · MIT
ai

Maps model strings to backend classes for unified LLM access.

# Source: https://github.com/416rehman/DeepZero | License: MIT | Copyright 2026 416rehman
# Provided via justclaw.it.com; keep this notice with the code.
"""llm backend registry.

model strings are `<scheme>` or `<scheme>/<model>`. a registered scheme selects
that backend; anything unrecognised falls through to the default backend
(litellm), which covers every api-key endpoint it supports.

    claude-code            -> ClaudeCodeBackend (default model)
    claude-code/sonnet     -> ClaudeCodeBackend (sonnet)
    openai/gpt-4o          -> default backend (litellm)
    gpt-4o                 -> default backend (litellm)
"""

from __future__ import annotations

from typing import Any

from deepzero.engine.backends.base import LLMBackend

_BACKEND_REGISTRY: dict[str, type[LLMBackend]] = {}
_D

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key