MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / managed_openai_route

Function managed_openai_route

e2e/python/test_inference_routing.py:146–165  ·  view source on GitHub ↗
(
    inference_client: InferenceRouteClient,
    sandbox_client: SandboxClient,
)

Source from the content-addressed store, hash-verified

144
145@pytest.fixture
146def managed_openai_route(
147 inference_client: InferenceRouteClient,
148 sandbox_client: SandboxClient,
149) -> Iterator[str]:
150 with _cluster_config_lock():
151 previous = _current_cluster_inference(inference_client)
152 _upsert_managed_inference(
153 inference_client,
154 sandbox_client,
155 provider_name=_MANAGED_OPENAI_PROVIDER_NAME,
156 provider_type="openai",
157 credential_key="OPENAI_API_KEY",
158 base_url_key="OPENAI_BASE_URL",
159 model_id=_MANAGED_OPENAI_MODEL_ID,
160 base_url="mock://e2e-managed-openai",
161 )
162 try:
163 yield _MANAGED_OPENAI_MODEL_ID
164 finally:
165 _restore_cluster_inference(inference_client, previous)
166
167
168def test_model_discovery_call_routed_to_backend(

Callers

nothing calls this directly

Calls 4

_cluster_config_lockFunction · 0.85

Tested by

no test coverage detected