Skip to content

Commit 05777cf

Browse files
Merge pull request #5 from IBM/bug/llm-factory
bug: llm factory not recognizing openai-compat vendor names
2 parents 862a8bb + 5f3b936 commit 05777cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/llm/llm_factory.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import logging
44
import os
5-
from typing import Dict, Any, Type, Callable, Optional, Union, TypeVar
5+
from typing import Dict, Any, Type, Optional, TypeVar
66

77
from .adapters.base_vendor_adapter import BaseVendorAdapter
88
from .adapters.watsonx.watsonx_config import WatsonXConfig
@@ -165,7 +165,11 @@ def _create_adapter(cls, vendor: str, model_id: str, **kwargs) -> BaseVendorAdap
165165
**kwargs
166166
)
167167

168-
# Handle standard adapters from registry
168+
# Check for OpenAI compatibility vendors (partial match)
169+
if "openai-compat" in vendor:
170+
return OpenAICompatAdapter(model_name=model_id, **kwargs)
171+
172+
# Handle standard adapters from registry with exact match
169173
adapter_class = cls._adapter_registry.get(vendor)
170174
if adapter_class:
171175
return adapter_class(model_name=model_id, **kwargs)

0 commit comments

Comments
 (0)