@@ -39,16 +39,12 @@ def test_openai_client_models(self, client: openai.OpenAI, backend: str):
3939 models = list (client .models .list ())
4040 print (f"Models: { models } " )
4141 if backend == "tensorrtllm" :
42- import os
43-
44- LLMAPI_SETUP = os .environ .get ("LLMAPI_SETUP" , 0 )
45- if LLMAPI_SETUP :
46- # LLM API setup only has the tensorrt_llm model
47- assert len (models ) == 1
48- else :
49- # tensorrt_llm_bls +
50- # preprocess -> tensorrt_llm -> postprocess
51- assert len (models ) == 4
42+ # tensorrt_llm_bls +
43+ # preprocess -> tensorrt_llm -> postprocess
44+ assert len (models ) == 4
45+ elif backend == "llmapi" :
46+ # Only has one tensorrt_llm model.
47+ assert len (models ) == 1
5248 elif backend == "vllm" :
5349 assert len (models ) == 1
5450 else :
@@ -82,7 +78,7 @@ def test_openai_client_chat_completion(
8278 def test_openai_client_completion_echo (
8379 self , client : openai .OpenAI , echo : bool , backend : str , model : str , prompt : str
8480 ):
85- if backend == "tensorrtllm" :
81+ if backend == "tensorrtllm" or backend == "llmapi" :
8682 pytest .skip (
8783 reason = "TRT-LLM backend currently only supports setting this parameter at model load time" ,
8884 )
@@ -112,16 +108,12 @@ async def test_openai_client_models(self, client: openai.AsyncOpenAI, backend: s
112108 models = [model async for model in async_models ]
113109 print (f"Models: { models } " )
114110 if backend == "tensorrtllm" :
115- import os
116-
117- LLMAPI_SETUP = os .environ .get ("LLMAPI_SETUP" , 0 )
118- if LLMAPI_SETUP :
119- # LLM API setup only has the tensorrt_llm model
120- assert len (models ) == 1
121- else :
122- # tensorrt_llm_bls +
123- # preprocess -> tensorrt_llm -> postprocess
124- assert len (models ) == 4
111+ # tensorrt_llm_bls +
112+ # preprocess -> tensorrt_llm -> postprocess
113+ assert len (models ) == 4
114+ elif backend == "llmapi" :
115+ # Only has one tensorrt_llm model.
116+ assert len (models ) == 1
125117 elif backend == "vllm" :
126118 assert len (models ) == 1
127119 else :
0 commit comments