Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:869413421 Ai moive studio Registry Connection

From Leeroopedia
Knowledge Sources
Domains Architecture, Configuration
Last Updated 2026-10-23 12:00 GMT

Overview

Module that validates and normalizes provider connection configurations, including URL scheme validation, AICON hostname migration, and model catalog loading/validation.

Description

registry module provides the connection normalization and configuration management for AI providers:

  • connection(): Validates URL scheme (http/https), rejects credentials/queries/fragments, migrates legacy AICON hostname, derives base_url (with /v1) and root_url (without /v1), and resolves source identifier
  • validate_config(): Validates model catalog structure (version, models array, unique pairs, capability constraints, defaults)
  • load_config(): Loads and caches the model catalog from models.json with content-addressed caching
  • selected_models(): Returns models for a given source, sorted by release date

Usage

Import when validating provider URLs or loading model catalog configurations. Used by ProviderFactory, GatewayProvider, and catalog module.

Code Reference

Source Location

  • Repository: ai-moive-studio
  • File: backend/src/services/provider/registry.py:L27-134

Signature

def connection(provider: str, base_url: str = None) -> Dict[str, str]: ...
def validate_config(data: dict) -> dict: ...
def load_config() -> dict: ...
def selected_models(source: str) -> list: ...

Import

from src.services.provider.registry import connection, load_config, selected_models, validate_config

I/O Contract

Inputs

Name Type Required Description
provider str Yes Provider name (lowercased)
base_url str No Custom base URL

Outputs

Name Type Description
connection() dict {provider, source, base_url, root_url}
load_config() dict Validated model catalog from models.json
selected_models() list Models for source, sorted by release date

Usage Examples

Resolving a Connection

from src.services.provider.registry import connection

conn = connection("openai", "https://api.openai.com/v1")
print(conn)
# {'provider': 'openai', 'source': 'openai',
#  'base_url': 'https://api.openai.com/v1',
#  'root_url': 'https://api.openai.com'}

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment