ZIm/docs/src
Cale Sennett 61ce07a91b
Add capabilities to OpenAI-compatible model settings (#36370)
### TL;DR
* Adds `capabilities` configuration for OpenAI-compatible models
* Relates to
https://github.com/zed-industries/zed/issues/36215#issuecomment-3193920491

### Summary
This PR introduces support for configuring model capabilities for
OpenAI-compatible language models. The implementation addresses the
issue that not all OpenAI-compatible APIs support the same features -
for example, Cerebras' API explicitly does not support
`parallel_tool_calls` as documented in their [OpenAI compatibility
guide](https://inference-docs.cerebras.ai/resources/openai#currently-unsupported-openai-features).

### Changes

1. **Model Capabilities Structure**:
- Added `ModelCapabilityToggles` struct for UI representation with
boolean toggle states
- Implemented proper parsing of capability toggles into
`ModelCapabilities`

2. **UI Updates**:
- Modified the "Add LLM Provider" modal to include checkboxes for each
capability
- Each OpenAI-compatible model can now be configured with its specific
capabilities through the UI

3. **Configuration File Structure**:
- Updated the settings schema to support a `capabilities` object for
each `openai_compatible` model
- Each capability (`tools`, `images`, `parallel_tool_calls`,
`prompt_cache_key`) can be individually specified per model

### Example Configuration

```json
{
  "openai_compatible": {
    "Cerebras": {
      "api_url": "https://api.cerebras.ai/v1",
      "available_models": [
        {
          "name": "gpt-oss-120b",
          "max_tokens": 131000,
          "capabilities": {
            "tools": true,
            "images": false,
            "parallel_tool_calls": false,
            "prompt_cache_key": false
          }
        }
      ]
    }
  }
}
```

### Tests Added

- Added tests to verify default capability values are correctly applied
- Added tests to verify that deselected toggles are properly parsed as
`false`
- Added tests to verify that mixed capability selections work correctly

Thanks to @osyvokon for the desired `capabilities` configuration
structure!


Release Notes:

- OpenAI-compatible models now have configurable capabilities (#36370;
thanks @calesennett)

---------

Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
2025-08-18 11:36:52 +03:00
..
ai Add capabilities to OpenAI-compatible model settings (#36370) 2025-08-18 11:36:52 +03:00
development docs: Update information in MSYS2 section (#36158) 2025-08-14 09:02:52 +03:00
extensions Improve extension development docs (#33646) 2025-08-08 21:44:03 +00:00
languages emmet: Extract to zed-extensions/emmet repository (#36323) 2025-08-16 17:02:51 +00:00
accounts.md docs: Restructure and improve AI configuration docs (#35133) 2025-07-26 16:06:12 +00:00
additional-learning-materials.md update docs content (#11374) 2024-05-03 16:24:04 -06:00
channels.md docs: Adjust the channels page a bit (#31636) 2025-05-28 19:27:47 -03:00
collaboration.md Clarify guests vs collaborators in project sharing docs (#22945) 2025-01-10 15:42:52 +00:00
completions.md docs: Overhaul AI documentation (#29747) 2025-05-07 01:07:12 -03:00
configuring-languages.md Improve Java LSP documentation (#34410) 2025-07-14 18:16:43 -04:00
configuring-zed.md Add setting for hiding the status_bar.cursor_position_button (#36288) 2025-08-16 09:19:38 +03:00
debugger.md docs: Discuss inlay_hints.show_value_hints in debugger docs (#34581) 2025-07-16 19:35:30 -04:00
development.md editor: Improve minimap performance (#33067) 2025-07-15 00:29:27 +03:00
diagnostics.md Add initial docs for editor diagnostics (#33325) 2025-06-24 22:21:27 +03:00
environment.md docs: Fix typo in environment documentation (#19164) 2024-10-13 16:47:09 -04:00
extensions.md extensions: Yet another PR for debugger touchups (#32822) 2025-06-17 07:34:55 +00:00
getting-started.md Fix keybinds and 'No default binding' shown in docs (#35227) 2025-07-28 14:58:43 -04:00
git.md Add meta description tag to docs pages (#35112) 2025-07-29 23:01:03 +00:00
globs.md Glob documentation (#18789) 2024-10-15 17:21:04 -04:00
helix.md Add some documentation for Helix mode (#35641) 2025-08-13 17:36:18 +00:00
icon-themes.md icon_theme_selector: Add footer and related docs (#25042) 2025-02-20 00:02:24 +00:00
key-bindings.md Add some documentation for Helix mode (#35641) 2025-08-13 17:36:18 +00:00
languages.md docs: Add Yara language extension (#28693) 2025-04-14 12:40:13 -04:00
linux.md docs: Remove link to openSUSE Tumbleweed (#36355) 2025-08-17 12:52:05 +00:00
multibuffers.md Fix a typo in the multi buffers documentation (#18535) 2024-09-30 15:28:46 +03:00
outline-panel.md docs: Add tweaks to the outline panel page (#18697) 2024-10-03 12:27:42 -03:00
remote-development.md docs: Update mentions to GitHub to use correct capitalization (#31996) 2025-06-03 14:55:24 -03:00
repl.md docs: Add tweaks to the REPL page (#18000) 2024-09-18 07:34:39 -03:00
snippets.md docs: Add better snippets documentation (#26853) 2025-03-19 18:05:05 +01:00
SUMMARY.md Add some documentation for Helix mode (#35641) 2025-08-13 17:36:18 +00:00
system-requirements.md Add initial FreeBSD script & installation doc (#30981) 2025-06-06 23:14:25 +00:00
tasks.md task: Add ZED_RELATIVE_DIR task variable (#31657) 2025-05-29 11:50:36 +02:00
telemetry.md onboarding: Remove feature flag and old welcome crate (#36110) 2025-08-13 13:18:24 -03:00
themes.md chore: remove redundant word in comment (#30338) 2025-05-09 07:33:20 +00:00
vim.md vim: Add debug panel ex command (#33560) 2025-06-27 21:32:40 -06:00
visual-customization.md Add setting for hiding the status_bar.cursor_position_button (#36288) 2025-08-16 09:19:38 +03:00
windows.md Remove callout for hiring (#33674) 2025-06-30 23:35:00 -07:00
workspace-persistence.md Add visual customization section to documentation (#33133) 2025-06-21 22:55:53 -04:00