zed/crates/agent
Sathiyaraman M 6e33d838c9
copilot: Display cost multiplier for Github Copilot models (#44800)
### Description

Related Discussions: #44499, #35742, #31851

Display cost multiplier for GitHub Copilot models in the model selectors
(Both in Chat Panel and Inline Assistant)

<img width="436" height="800" alt="image"
src="https://github.com/user-attachments/assets/c9ebd8fa-4d55-4be8-b3e1-f46dbf1f0145"
/>


### Some technical notes

Although this PR's primary intent is to show the cost multiplier for
GitHub Copilot models alone, I have included some necessary plumbing to
allow specifying costs for other providers in future. I have introduced
an enum called `LanguageModelCostInfo` for showing cost in different
ways for different models. Now, this enum is used in `LanguageModel`
trait to get the cost info.

For now to begin with, in `LanguageModelCostInfo`, I have specified two
ways of pricing: Request-based (1 Agent request - GitHub Copilot uses
this) and Token-based (1M Input tokens / 1M Output tokens). I had
initially thought about adding a `Free` type, especially for Ollama but
didn't do it after realizing that Ollama has paid plans. Right now, only
the Request-based pricing is implemented and used for Copilot models.

Feel free to suggest changes on how to improve this design better.

Release Notes:

- Show cost multiplier for GitHub Copilot models

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-02-16 15:24:59 -03:00
..
src copilot: Display cost multiplier for Github Copilot models (#44800) 2026-02-16 15:24:59 -03:00
Cargo.toml agent: Sanitize MCP server IDs in tool name disambiguation (#45789) 2026-02-12 14:43:14 +00:00
LICENSE-GPL Rename assistant2 to agent (#27887) 2025-04-02 00:40:47 +00:00