# language_models: Make \`JsonSchemaSubset\` the default \`tool_input_format\` for the OpenAI-compatible provider \(\#34921\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4c411b9fc825a6a6d5eb6267b6379d6d613a48c9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4c411b9fc825a6a6d5eb6267b6379d6d613a48c9

Requested commit: 4c411b9fc825a6a6d5eb6267b6379d6d613a48c9

Commit: 4c411b9fc825a6a6d5eb6267b6379d6d613a48c9

Tree: 199fd9e94f7383eb3d1b8784782e8cdc6e16fcce

Author: Umesh Yadav

Committer: GitHub

## Message

```
language_models: Make `JsonSchemaSubset` the default `tool_input_format` for the OpenAI-compatible provider (#34921)

Closes #30188
Closes #34911
Closes #34906

Many OpenAI-compatible providers do not automatically filter the tool
schema to comply with the underlying model's requirements; they simply
proxy the request. This creates issues, as models like **Gemini**,
**Grok**, and **Claude** (when accessed via LiteLLM on Bedrock) are
incompatible with Zed's default tool schema.

This PR addresses this by defaulting to a more compatible schema subset
instead of the full schema.

### Why this approach?

* **Avoids Poor User Experience:** One alternative was to add an option
for users to manually set the JSON schema for models that return a `400
Bad Request` due to an invalid tool schema. This was discarded as it
provides a poor user experience.
* **Simplifies Complex Logic:** Another option was to filter the schema
based on the model ID. However, as demonstrated in the attached issues,
this is unreliable. For instance, `claude-4-sonnet` fails when proxied
through LiteLLM on Bedrock. Reliably determining behavior would require
a non-trivial implementation to manage provider-and-model combinations.
* **Better Default Behavior:** The current approach ensures that tool
usage works out-of-the-box for the majority of cases by default,
providing the most robust and user-friendly solution.


Release Notes:

- Improved tool compatibility with OpenAI API-compatible providers

Signed-off-by: Umesh Yadav <git@umesh.dev>
Co-authored-by: Peter Tripp <peter@zed.dev>
```

## Parents

- [5ac6ae501f21e6700b062d1513d0e59e1a29079e](https://git.cafe/gitcafe/zed/commit/5ac6ae501f21e6700b062d1513d0e59e1a29079e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4c411b9fc825a6a6d5eb6267b6379d6d613a48c9?format=markdown)
