@@ -37,6 +37,7 @@ use dynamo_llm::{self as llm_rs};
3737use dynamo_llm:: { entrypoint:: RouterConfig , kv_router:: KvRouterConfig } ;
3838
3939use crate :: llm:: local_model:: ModelRuntimeConfig ;
40+ use crate :: llm:: preprocessor:: { MediaDecoder , MediaFetcher } ;
4041
4142#[ pyclass( eq, eq_int) ]
4243#[ derive( Clone , Debug , PartialEq ) ]
@@ -159,6 +160,8 @@ fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> {
159160 m. add_class :: < llm:: model_card:: ModelDeploymentCard > ( ) ?;
160161 m. add_class :: < llm:: local_model:: ModelRuntimeConfig > ( ) ?;
161162 m. add_class :: < llm:: preprocessor:: OAIChatPreprocessor > ( ) ?;
163+ m. add_class :: < llm:: preprocessor:: MediaDecoder > ( ) ?;
164+ m. add_class :: < llm:: preprocessor:: MediaFetcher > ( ) ?;
162165 m. add_class :: < llm:: backend:: Backend > ( ) ?;
163166 m. add_class :: < llm:: kv:: OverlapScores > ( ) ?;
164167 m. add_class :: < llm:: kv:: KvIndexer > ( ) ?;
@@ -215,7 +218,7 @@ fn log_message(level: &str, message: &str, module: &str, file: &str, line: u32)
215218/// Create an engine and attach it to an endpoint to make it visible to the frontend.
216219/// This is the main way you create a Dynamo worker / backend.
217220#[ pyfunction]
218- #[ pyo3( signature = ( model_input, model_type, endpoint, model_path, model_name=None , context_length=None , kv_cache_block_size=None , router_mode=None , migration_limit=0 , runtime_config=None , user_data=None , custom_template_path=None ) ) ]
221+ #[ pyo3( signature = ( model_input, model_type, endpoint, model_path, model_name=None , context_length=None , kv_cache_block_size=None , router_mode=None , migration_limit=0 , runtime_config=None , user_data=None , custom_template_path=None , media_decoder= None , media_fetcher= None ) ) ]
219222#[ allow( clippy:: too_many_arguments) ]
220223fn register_llm < ' p > (
221224 py : Python < ' p > ,
@@ -231,6 +234,8 @@ fn register_llm<'p>(
231234 runtime_config : Option < ModelRuntimeConfig > ,
232235 user_data : Option < & Bound < ' p , PyDict > > ,
233236 custom_template_path : Option < & str > ,
237+ media_decoder : Option < MediaDecoder > ,
238+ media_fetcher : Option < MediaFetcher > ,
234239) -> PyResult < Bound < ' p , PyAny > > {
235240 // Validate Prefill model type requirements
236241 if model_type. inner == llm_rs:: model_type:: ModelType :: Prefill {
@@ -303,7 +308,9 @@ fn register_llm<'p>(
303308 . migration_limit ( Some ( migration_limit) )
304309 . runtime_config ( runtime_config. unwrap_or_default ( ) . inner )
305310 . user_data ( user_data_json)
306- . custom_template_path ( custom_template_path_owned) ;
311+ . custom_template_path ( custom_template_path_owned)
312+ . media_decoder ( media_decoder. map ( |m| m. inner ) )
313+ . media_fetcher ( media_fetcher. map ( |m| m. inner ) ) ;
307314 // Load the ModelDeploymentCard
308315 let mut local_model = builder. build ( ) . await . map_err ( to_pyerr) ?;
309316 // Advertise ourself on etcd so ingress can find us
0 commit comments