We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf6ec1a commit 3e9472cCopy full SHA for 3e9472c
src/strands_env/utils/sglang.py
@@ -19,6 +19,7 @@
19
from functools import lru_cache
20
from typing import Any
21
22
+import httpx
23
from strands_sglang import SGLangClient
24
25
_SGLANG_CLIENT_CONFIG = {
@@ -45,3 +46,10 @@ def get_cached_client_from_slime_args(args: Any) -> SGLangClient:
45
46
def clear_clients() -> None:
47
"""Clear all cached `SGLangClient` instances."""
48
get_cached_client.cache_clear()
49
+
50
51
+def get_model_id(base_url: str) -> str:
52
+ """Get the model ID from the SGLang server."""
53
+ response = httpx.get(f"{base_url}/get_model_info", timeout=5)
54
+ response.raise_for_status()
55
+ return response.json()["model_path"]
0 commit comments