@@ -44,7 +44,6 @@ mod local {
4444/// The default engine creator for the LLM factor when used in the Spin CLI.
4545pub fn default_engine_creator (
4646 state_dir : Option < PathBuf > ,
47- use_gpu : bool ,
4847) -> anyhow:: Result < impl LlmEngineCreator + ' static > {
4948 #[ cfg( feature = "llm" ) ]
5049 let engine = {
@@ -53,11 +52,11 @@ pub fn default_engine_creator(
5352 Some ( ref dir) => dir. clone ( ) ,
5453 None => std:: env:: current_dir ( ) . context ( "failed to get current working directory" ) ?,
5554 } ;
56- spin_llm_local:: LocalLlmEngine :: new ( models_dir_parent. join ( "ai-models" ) , use_gpu )
55+ spin_llm_local:: LocalLlmEngine :: new ( models_dir_parent. join ( "ai-models" ) )
5756 } ;
5857 #[ cfg( not( feature = "llm" ) ) ]
5958 let engine = {
60- let _ = ( state_dir, use_gpu ) ;
59+ let _ = ( state_dir) ;
6160 noop:: NoopLlmEngine
6261 } ;
6362 let engine = Arc :: new ( Mutex :: new ( engine) ) as Arc < Mutex < dyn LlmEngine > > ;
@@ -91,15 +90,14 @@ impl LlmEngine for RemoteHttpLlmEngine {
9190pub fn runtime_config_from_toml (
9291 table : & impl GetTomlValue ,
9392 state_dir : Option < PathBuf > ,
94- use_gpu : bool ,
9593) -> anyhow:: Result < Option < RuntimeConfig > > {
9694 let Some ( value) = table. get ( "llm_compute" ) else {
9795 return Ok ( None ) ;
9896 } ;
9997 let config: LlmCompute = value. clone ( ) . try_into ( ) ?;
10098
10199 Ok ( Some ( RuntimeConfig {
102- engine : config. into_engine ( state_dir, use_gpu ) ?,
100+ engine : config. into_engine ( state_dir) ?,
103101 } ) )
104102}
105103
@@ -111,19 +109,15 @@ pub enum LlmCompute {
111109}
112110
113111impl LlmCompute {
114- fn into_engine (
115- self ,
116- state_dir : Option < PathBuf > ,
117- use_gpu : bool ,
118- ) -> anyhow:: Result < Arc < Mutex < dyn LlmEngine > > > {
112+ fn into_engine ( self , state_dir : Option < PathBuf > ) -> anyhow:: Result < Arc < Mutex < dyn LlmEngine > > > {
119113 let engine: Arc < Mutex < dyn LlmEngine > > = match self {
120114 #[ cfg( not( feature = "llm" ) ) ]
121115 LlmCompute :: Spin => {
122- let _ = ( state_dir, use_gpu ) ;
116+ let _ = ( state_dir) ;
123117 Arc :: new ( Mutex :: new ( noop:: NoopLlmEngine ) )
124118 }
125119 #[ cfg( feature = "llm" ) ]
126- LlmCompute :: Spin => default_engine_creator ( state_dir, use_gpu ) ?. create ( ) ,
120+ LlmCompute :: Spin => default_engine_creator ( state_dir) ?. create ( ) ,
127121 LlmCompute :: RemoteHttp ( config) => Arc :: new ( Mutex :: new ( RemoteHttpLlmEngine :: new (
128122 config. url ,
129123 config. auth_token ,
0 commit comments