MCPcopy
hub / github.com/IBM/AssetOpsBench / _system_from_model

Function _system_from_model

src/observability/runspan.py:37–45  ·  view source on GitHub ↗

Best-effort provider family from a model ID; returns ``"unknown"`` when the shape isn't recognized.

(model_id: str)

Source from the content-addressed store, hash-verified

35
36
37def _system_from_model(model_id: str) -> str:
38 """Best-effort provider family from a model ID; returns ``"unknown"``
39 when the shape isn't recognized."""
40 mid = model_id.removeprefix("litellm_proxy/")
41 head, _, _ = mid.partition("/")
42 # Only aliases actually emitted by this repo are mapped.
43 if head.lower() == "aws":
44 return "anthropic"
45 return head.lower() or "unknown"
46
47
48@contextmanager

Callers 2

test_system_from_modelFunction · 0.90
agent_run_spanFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_system_from_modelFunction · 0.72