@@ -123,6 +123,8 @@ def get_litellm_config(
123123 litellm_config .update (
124124 {"model" : model_config ["model" ], "api_base" : full_model_config .get ("api_base" ), "drop_params" : True }
125125 )
126+ if "api_key" in full_model_config :
127+ litellm_config ["api_key" ] = full_model_config ["api_key" ]
126128
127129 if provider == "oci" :
128130 litellm_config .update (
@@ -159,19 +161,18 @@ def get_client_embed(model_config: dict, oci_config: schema.OracleCloudSettings)
159161 else :
160162 if provider == "hosted_vllm" :
161163 kwargs = {
162- "provider" : "openai" ,
163- "model" : full_model_config ["id" ],
164- "base_url" : full_model_config .get ("api_base" ),
165- "check_embedding_ctx_length" :False # To avoid Tiktoken pre-transform on not OpenAI provided server
164+ "provider" : "openai" ,
165+ "model" : full_model_config ["id" ],
166+ "base_url" : full_model_config .get ("api_base" ),
167+ "check_embedding_ctx_length" : False , # To avoid Tiktoken pre-transform on not OpenAI provided server
166168 }
167169 else :
168170 kwargs = {
169- "provider" : provider ,
170- "model" : full_model_config ["id" ],
171- "base_url" : full_model_config .get ("api_base" ),
171+ "provider" : provider ,
172+ "model" : full_model_config ["id" ],
173+ "base_url" : full_model_config .get ("api_base" ),
172174 }
173175
174-
175176 if full_model_config .get ("api_key" ): # only add if set
176177 kwargs ["api_key" ] = full_model_config ["api_key" ]
177178 client = init_embeddings (** kwargs )
0 commit comments