Best-effort provider family from a model ID; returns ``"unknown"`` when the shape isn't recognized.
(model_id: str)
| 35 | |
| 36 | |
| 37 | def _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 |
no outgoing calls