Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions fix(llm): raise clear error for invalid model identifiers
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Summary

Fixes invalid model string handling in the LLM client.

`LLM.completion()` and `LLM.chat()` currently assume the model identifier always contains a `/` separator and directly access `model.split("/")[1]`. When a caller passes a plain string such as `"gpt-5"`, the SDK raises an unhelpful `IndexError` instead of a clear validation error.

This PR adds a shared parser that validates model identifiers and raises a descriptive `ValueError` when the input is not in `provider/model-name` format.

Fixes #249

## Problem

Both `LLM.completion()` and `LLM.chat()` strip the provider prefix with direct string splitting:

```python
model.split("/")[1]
Loading