Skip to main content
Model configuration loader. Reads model definition YAML files from the configs/ directory and builds ModelSpec instances. This is the single source of truth for all model specifications.

EndpointPaths

Parsed endpoint routes for a model. Each field corresponds to an optional endpoint type declared in the model’s YAML config under endpoints:.

HuggingFaceConfig

Hugging Face Hub build recipe for an embedding backbone. Declares how to build the model directly from the Hub via timm for the in-process huggingface backend. Present only on configs of models that can be served this way. Attributes:
  • repo_id - Hugging Face Hub repository ID (without the hf-hub: prefix), e.g. "bioptimus/H-optimus-0".
  • timm_kwargs - Raw keyword arguments forwarded to timm.create_model. String values are treated as dotted import paths (e.g. "timm.layers.SwiGLUPacked") and resolved to the referenced object at build time via resolve_dotted_path; other values are passed through unchanged.

resolve_dotted_path

Resolves a dotted import path to the object it references. Imports the containing module and returns the named attribute, e.g. "timm.layers.SwiGLUPacked" imports timm.layers and returns SwiGLUPacked. Kept lazy (imports happen only when called) so that backends other than huggingface never import timm.
A dotted path of the form "module.submodule.attribute".
Returns: The object referenced by path. Raises:
  • ValueError - If path does not contain a module component.
  • ImportError - If the module cannot be imported.
  • AttributeError - If the attribute does not exist on the module.

ModelConfig

A fully parsed model configuration. Combines the ModelSpec with routing metadata that is not part of the spec itself.

endpoint_path

Primary endpoint path (backward compatibility).

genes_endpoint_path

Genes/metadata endpoint path (backward compatibility).

load_model_config

Loads a single model config YAML file.
Path to the YAML file.
Returns: A ModelConfig with the parsed spec and routing.

load_all_model_configs

Discovers and loads all model configs from a directory. Scans for *.yaml files and returns a dict keyed by model_name.
Directory to scan. Defaults to the package-bundled configs/ directory.
Returns: Mapping of model name to ModelConfig.