Configuration
All configuration options for lexigram-multimedia-interpolate.
Overview
Section titled “Overview”InterpolationConfig extends BaseConfig (stdlib dataclasses, not pydantic)
and declares its section via config_section = "multimedia_interpolate".
Loading follows the canonical BaseConfig.from_yaml() order — each later
source overrides the previous:
application.yamlvalues (base layer)- Profile overlay
application.{LEX_PROFILE}.yaml(if set) LEX_*environment variables
InterpolationGenerationProvider passes the section into the container
(config_key = "multimedia_interpolate"). Under the lexigram-multimedia
umbrella, the same keys nest as multimedia: interpolate:.
The config surface is deliberately tiny: frame-pair interpolation needs only a
backend, a server URL, and a timeout. There is no factor/fps knob here — those
are per-call arguments on VideoInterpolationService.interpolate_video().
Basic Example
Section titled “Basic Example”multimedia_interpolate: backend: "rife" rife_base_url: "http://localhost:5500" timeout: 30.0config = InterpolationConfig.from_yaml("application.yaml") # section used automaticallyassert config.backend == "rife"Programmatic equivalent:
from lexigram.multimedia.interpolate import InterpolationModulefrom lexigram.multimedia.interpolate.config import InterpolationConfig
module = InterpolationModule.configure(config=InterpolationConfig(timeout=30.0))Options
Section titled “Options”All fields of InterpolationConfig:
| Option | Type | Default | Description |
|---|---|---|---|
backend | Literal["rife"] | "rife" | Interpolation backend to register (only rife is implemented) |
rife_base_url | str | "http://localhost:5500" | Base URL of the RIFE reference server |
timeout | float | 15.0 | HTTP request timeout in seconds for /interpolate |
Environment Variables
Section titled “Environment Variables”Prefix: LEX_MULTIMEDIA__INTERPOLATE__ (umbrella-layout YAML) or
LEX_MULTIMEDIA_INTERPOLATE__ (flat multimedia_interpolate section). Field
names map directly:
| Variable | Description |
|---|---|
LEX_MULTIMEDIA__INTERPOLATE__BACKEND | Backend selection (rife) |
LEX_MULTIMEDIA__INTERPOLATE__RIFE_BASE_URL | RIFE server URL |
LEX_MULTIMEDIA__INTERPOLATE__TIMEOUT | Request timeout in seconds |
Example:
export LEX_MULTIMEDIA__INTERPOLATE__RIFE_BASE_URL=http://rife.internal:5500export LEX_MULTIMEDIA__INTERPOLATE__TIMEOUT=45Advanced Configuration
Section titled “Advanced Configuration”Resilience Wrapping
Section titled “Resilience Wrapping”RifeInterpolationProvider accepts optional RetryPolicyProtocol /
CircuitBreakerProtocol instances. Under DI they resolve automatically when
registered in the container, wrapping every /interpolate call. Direct
construction works too:
from lexigram.multimedia.interpolate.providers import RifeInterpolationProvider
backend = RifeInterpolationProvider( base_url="http://localhost:5500", timeout=15.0, retry=my_retry_policy, circuit_breaker=my_circuit_breaker,)Composing with a VideoProcessor
Section titled “Composing with a VideoProcessor”The VideoInterpolationService registration is automatic: if the container
has a VideoProcessor (from lexigram-multimedia-video), the provider
composes VideoInterpolationService(interpolation_provider, video_processor)
and registers it. No config keys control this — presence of the protocol in
the container is the only switch:
service = await app.container.resolve(VideoInterpolationService)result = await service.interpolate_video(asset, factor=2, fps=24.0)Profile-Based Overlays
Section titled “Profile-Based Overlays”export LEX_PROFILE=productionwith application.production.yaml overriding just the server URL — env vars
still win over the profile file.
Best Practices
Section titled “Best Practices”- Keep config minimal — only
rife_base_urlandtimeoutmatter in practice. - Prefer environment variables for per-deployment server URLs (
riferuns on a different host in prod). - Raise
timeoutfor slow GPUs; interpolation of large frames is compute-bound, not network-bound. - Use
InterpolationModule.stub()in tests (pins the realrifebackend without a live server).