@@ -39,6 +39,7 @@ use dynamo_llm::{self as llm_rs};
3939use dynamo_llm:: { entrypoint:: RouterConfig , kv_router:: KvRouterConfig } ;
4040
4141use crate :: llm:: local_model:: ModelRuntimeConfig ;
42+ use crate :: llm:: preprocessor:: { MediaDecoder , MediaFetcher } ;
4243
4344#[ pyclass( eq, eq_int) ]
4445#[ derive( Clone , Debug , PartialEq ) ]
@@ -161,6 +162,8 @@ fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> {
161162 m. add_class :: < llm:: model_card:: ModelDeploymentCard > ( ) ?;
162163 m. add_class :: < llm:: local_model:: ModelRuntimeConfig > ( ) ?;
163164 m. add_class :: < llm:: preprocessor:: OAIChatPreprocessor > ( ) ?;
165+ m. add_class :: < llm:: preprocessor:: MediaDecoder > ( ) ?;
166+ m. add_class :: < llm:: preprocessor:: MediaFetcher > ( ) ?;
164167 m. add_class :: < llm:: backend:: Backend > ( ) ?;
165168 m. add_class :: < llm:: kv:: OverlapScores > ( ) ?;
166169 m. add_class :: < llm:: kv:: KvIndexer > ( ) ?;
@@ -217,7 +220,7 @@ fn log_message(level: &str, message: &str, module: &str, file: &str, line: u32)
217220/// Create an engine and attach it to an endpoint to make it visible to the frontend.
218221/// This is the main way you create a Dynamo worker / backend.
219222#[ pyfunction]
220- #[ 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 ) ) ]
223+ #[ 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 ) ) ]
221224#[ allow( clippy:: too_many_arguments) ]
222225fn register_llm < ' p > (
223226 py : Python < ' p > ,
@@ -233,6 +236,8 @@ fn register_llm<'p>(
233236 runtime_config : Option < ModelRuntimeConfig > ,
234237 user_data : Option < & Bound < ' p , PyDict > > ,
235238 custom_template_path : Option < & str > ,
239+ media_decoder : Option < MediaDecoder > ,
240+ media_fetcher : Option < MediaFetcher > ,
236241) -> PyResult < Bound < ' p , PyAny > > {
237242 // Validate Prefill model type requirements
238243 if model_type. inner == llm_rs:: model_type:: ModelType :: Prefill {
@@ -305,7 +310,9 @@ fn register_llm<'p>(
305310 . migration_limit ( Some ( migration_limit) )
306311 . runtime_config ( runtime_config. unwrap_or_default ( ) . inner )
307312 . user_data ( user_data_json)
308- . custom_template_path ( custom_template_path_owned) ;
313+ . custom_template_path ( custom_template_path_owned)
314+ . media_decoder ( media_decoder. map ( |m| m. inner ) )
315+ . media_fetcher ( media_fetcher. map ( |m| m. inner ) ) ;
309316 // Load the ModelDeploymentCard
310317 let mut local_model = builder. build ( ) . await . map_err ( to_pyerr) ?;
311318 // Advertise ourself on etcd so ingress can find us
0 commit comments