zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.47k stars 2.89k forks source link

Google Vertex AI provider with Region Selection support #18493

Open zerocorebeta opened 2 weeks ago

zerocorebeta commented 2 weeks ago

Check for existing issues

Describe the feature

Platforms like Cursor.ai and Continue.dev allow the use of Vertex AI as a provider, which offers models like Gemini Flash and Gemini Pro. A key benefit of Vertex AI is region selection, enabling users to pick servers closer to them for lower latency.

Additionally, using Vertex AI provides other advantages, such as unified billing with GCP. Many companies already use Google Cloud, so activating Vertex AI is as simple as enabling a service they’re already paying for.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

notpeter commented 4 days ago

Does Vertex AI have a distinct API semantics or is it just an alternate endpoint for Gemini Flash / Gemini Pro? If the latter it may just require tweaking our endpoint code.

See: Assistant Configuration: Custom Endpoint in the docs.

Currently we assume the following URL structure under that endpoint: https://github.com/zed-industries/zed/blob/cdead5760a2c200179e6a51d5a396c33a3e06e3d/crates/google_ai/src/google_ai.rs#L20-L23

But looking at the Vertex AI docs I think the endpoints are alternatively of the form:

https://us-central1-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/us-central1/publishers/google/models/${MODEL_ID}:streamGenerateContent