[smg][ci] rename 3rd models from cloud backend and delete dead code (#16692)
This commit is contained in:
@@ -26,7 +26,7 @@ from .constants import ( # Enums; Convenience sets; Fixture parameters; Default
|
||||
Runtime,
|
||||
WorkerType,
|
||||
)
|
||||
from .gateway import Gateway, WorkerInfo
|
||||
from .gateway import Gateway, WorkerInfo, launch_cloud_gateway
|
||||
from .gpu_allocator import (
|
||||
GPUAllocator,
|
||||
GPUInfo,
|
||||
@@ -54,6 +54,7 @@ from .model_specs import ( # Default model paths; Model groups
|
||||
FUNCTION_CALLING_MODELS,
|
||||
MODEL_SPECS,
|
||||
REASONING_MODELS,
|
||||
THIRD_PARTY_MODELS,
|
||||
)
|
||||
from .process_utils import (
|
||||
detect_ib_device,
|
||||
@@ -121,6 +122,7 @@ __all__ = [
|
||||
# Gateway
|
||||
"Gateway",
|
||||
"WorkerInfo",
|
||||
"launch_cloud_gateway",
|
||||
# Default model paths
|
||||
"DEFAULT_MODEL_PATH",
|
||||
"DEFAULT_SMALL_MODEL_PATH",
|
||||
@@ -135,6 +137,8 @@ __all__ = [
|
||||
"EMBEDDING_MODELS",
|
||||
"REASONING_MODELS",
|
||||
"FUNCTION_CALLING_MODELS",
|
||||
# Third-party models
|
||||
"THIRD_PARTY_MODELS",
|
||||
# Evaluation
|
||||
"run_eval",
|
||||
]
|
||||
|
||||
@@ -554,3 +554,42 @@ class Gateway:
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb) -> None:
|
||||
self.shutdown()
|
||||
|
||||
|
||||
def launch_cloud_gateway(
|
||||
runtime: str, # "openai" or "xai"
|
||||
*,
|
||||
history_backend: str = "memory",
|
||||
extra_args: list[str] | None = None,
|
||||
timeout: float = 60,
|
||||
show_output: bool | None = None,
|
||||
) -> Gateway:
|
||||
"""Launch gateway with cloud API runtime.
|
||||
|
||||
Args:
|
||||
runtime: Cloud runtime ("openai" or "xai")
|
||||
history_backend: History storage backend ("memory" or "oracle")
|
||||
extra_args: Additional router arguments
|
||||
timeout: Startup timeout in seconds
|
||||
show_output: Show subprocess output
|
||||
|
||||
Returns:
|
||||
Gateway instance with running router
|
||||
"""
|
||||
from .model_specs import THIRD_PARTY_MODELS
|
||||
|
||||
if runtime not in THIRD_PARTY_MODELS:
|
||||
raise ValueError(
|
||||
f"Unknown cloud runtime: {runtime}. "
|
||||
f"Available: {list(THIRD_PARTY_MODELS.keys())}"
|
||||
)
|
||||
|
||||
gateway = Gateway()
|
||||
gateway.start(
|
||||
cloud_backend=runtime,
|
||||
history_backend=history_backend,
|
||||
timeout=timeout,
|
||||
show_output=show_output,
|
||||
extra_args=extra_args,
|
||||
)
|
||||
return gateway
|
||||
|
||||
@@ -131,3 +131,21 @@ DEFAULT_QWEN_FUNCTION_CALLING_MODEL_PATH = MODEL_SPECS["qwen-7b"]["model"]
|
||||
DEFAULT_MISTRAL_FUNCTION_CALLING_MODEL_PATH = MODEL_SPECS["mistral-7b"]["model"]
|
||||
DEFAULT_GPT_OSS_MODEL_PATH = MODEL_SPECS["gpt-oss"]["model"]
|
||||
DEFAULT_EMBEDDING_MODEL_PATH = MODEL_SPECS["embedding"]["model"]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Third-party model configurations (cloud APIs)
|
||||
# =============================================================================
|
||||
|
||||
THIRD_PARTY_MODELS: dict[str, dict] = {
|
||||
"openai": {
|
||||
"description": "OpenAI API",
|
||||
"model": "gpt-5-nano",
|
||||
"api_key_env": "OPENAI_API_KEY",
|
||||
},
|
||||
"xai": {
|
||||
"description": "xAI API",
|
||||
"model": "grok-4-fast",
|
||||
"api_key_env": "XAI_API_KEY",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user