1# Inline Assistant
2
3## Usage Overview
4
5Use {#kb assistant::InlineAssist} to open the Inline Assistant in editors, text threads, the rules library, channel notes, and the terminal panel.
6
7The Inline Assistant sends your current selection (or line) to a language model and replaces it with the response.
8
9## Getting Started
10
11If you're using the Inline Assistant for the first time, you need to have at least one LLM provider or external agent configured.
12You can do that by:
13
141. [subscribing to our Pro plan](https://zed.dev/pricing), so you have access to our hosted models
152. [using your own API keys](./llm-providers.md#use-your-own-keys), either from model providers like Anthropic or model gateways like OpenRouter.
16
17If you have already set up an LLM provider to interact with [the Agent Panel](./agent-panel.md#getting-started), then that will also work for the Inline Assistant.
18
19> Unlike the Agent Panel, though, the only exception at the moment is [external agents](./external-agents.md).
20> They currently can't be used for generating changes with the Inline Assistant.
21
22## Adding Context
23
24You can add context in the Inline Assistant the same way you can in [the Agent Panel](./agent-panel.md#adding-context):
25
26- @-mention files, directories, past threads, rules, and symbols
27- paste images that are copied on your clipboard
28
29You can also create a thread in the Agent Panel, then reference it with `@thread` in the Inline Assistant. This lets you refine a specific change from a larger thread without re-explaining context.
30
31## Parallel Generations
32
33The Inline Assistant can generate multiple changes at once:
34
35### Multiple Cursors
36
37With multiple cursors, pressing {#kb assistant::InlineAssist} sends the same prompt to each cursor position, generating changes at all locations simultaneously.
38
39This works well with excerpts in [multibuffers](../multibuffers.md).
40
41### Multiple Models
42
43You can use the Inline Assistant to send the same prompt to multiple models at once.
44
45Here's how you can customize your `settings.json` to add this functionality:
46
47```json [settings]
48{
49 "agent": {
50 "default_model": {
51 "provider": "zed.dev",
52 "model": "claude-sonnet-4"
53 },
54 "inline_alternatives": [
55 {
56 "provider": "zed.dev",
57 "model": "gpt-4-mini"
58 }
59 ]
60 }
61}
62```
63
64When multiple models are configured, you'll see in the Inline Assistant UI buttons that allow you to cycle between outputs generated by each model.
65
66The models you specify here are always used in _addition_ to your [default model](#default-model).
67
68For example, the following configuration will generate three outputs for every assist.
69One with Claude Sonnet 4 (the default model), another with GPT-5-mini, and another one with Gemini 2.5 Flash.
70
71```json [settings]
72{
73 "agent": {
74 "default_model": {
75 "provider": "zed.dev",
76 "model": "claude-sonnet-4"
77 },
78 "inline_alternatives": [
79 {
80 "provider": "zed.dev",
81 "model": "gpt-4-mini"
82 },
83 {
84 "provider": "zed.dev",
85 "model": "gemini-2.5-flash"
86 }
87 ]
88 }
89}
90```
91
92## Inline Assistant vs. Edit Prediction
93
94Both features generate inline code, but they work differently:
95
96- **Inline Assistant**: You write a prompt and select what to transform. You control the context.
97- **[Edit Prediction](./edit-prediction.md)**: Zed automatically suggests edits based on your recent changes, visited files, and cursor position. No prompting required.
98
99The key difference: Inline Assistant is explicit and prompt-driven; Edit Prediction is automatic and context-inferred.
100
101## Prefilling Prompts
102
103To create a custom keybinding that prefills a prompt, you can add the following format in your keymap:
104
105```json [keymap]
106[
107 {
108 "context": "Editor && mode == full",
109 "bindings": {
110 "ctrl-shift-enter": [
111 "assistant::InlineAssist",
112 { "prompt": "Build a snake game" }
113 ]
114 }
115 }
116]
117```