mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-25 14:44:28 +00:00
### 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> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||