From 64c55b038f1e676c11bc4a2fdfbc8117f03144ca Mon Sep 17 00:00:00 2001 From: excited gui <170822527+alan-codes-things@users.noreply.github.com> Date: Tue, 7 Jul 2026 10:53:16 +0100 Subject: [PATCH] Change OpenAI compatible URL placeholder in edit prediction settings (#58771) Fixed my PR #58753. Change the url placeholder from http://localhost:11434 to http://localhost:8080/v1/completions to match the URL endpoint in the [docs](https://zed.dev/docs/ai/edit-prediction) ```json { "edit_predictions": { "provider": "open_ai_compatible_api", "open_ai_compatible_api": { "api_url": "http://localhost:8080/v1/completions", "model": "deepseek-coder-6.7b-base", "prompt_format": "deepseek_coder", "max_output_tokens": 512 } } } ``` Note: http://localhost:8080/v1/completions/ with an extra / does not work. Added the constants OPEN_AI_COMPATIBLE_API_URL_PLACEHOLDER and OPEN_AI_COMPATIBLE_MODEL_PLACEHOLDER. ### Initial Issue I noticed that using http://localhost:8080 doesn't work with llama.cpp. Giving errors like this from (zed: open log): ``` 2026-06-06T17:55:39+01:00 ERROR [crates/edit_prediction/src/edit_prediction.rs:2464] custom server error: 404 Not Found - {"error":{"message":"File Not Found","type":"not_found_error","code":404}} ``` After reading the docs above, I found out that I had to add /v1/completions to the end. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- .../src/pages/edit_prediction_provider_setup.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/settings_ui/src/pages/edit_prediction_provider_setup.rs b/crates/settings_ui/src/pages/edit_prediction_provider_setup.rs index 3f756a876a..01550cd16e 100644 --- a/crates/settings_ui/src/pages/edit_prediction_provider_setup.rs +++ b/crates/settings_ui/src/pages/edit_prediction_provider_setup.rs @@ -15,6 +15,9 @@ use workspace::AppState; const OLLAMA_API_URL_PLACEHOLDER: &str = "http://localhost:11434"; const OLLAMA_MODEL_PLACEHOLDER: &str = "qwen2.5-coder:3b-base"; +const OPEN_AI_COMPATIBLE_API_URL_PLACEHOLDER: &str = "http://localhost:8080/v1/completions"; +const OPEN_AI_COMPATIBLE_MODEL_PLACEHOLDER: &str = "qwen2.5-coder:3b-base"; + use crate::{ SettingField, SettingItem, SettingsFieldMetadata, SettingsPageItem, SettingsWindow, USER, components::{SettingsInputField, SettingsSectionHeader}, @@ -526,7 +529,7 @@ fn open_ai_compatible_settings() -> Box<[SettingsPageItem]> { json_path: Some("edit_predictions.open_ai_compatible_api.api_url"), }), metadata: Some(Box::new(SettingsFieldMetadata { - placeholder: Some(OLLAMA_API_URL_PLACEHOLDER), + placeholder: Some(OPEN_AI_COMPATIBLE_API_URL_PLACEHOLDER), ..Default::default() })), files: USER, @@ -560,7 +563,7 @@ fn open_ai_compatible_settings() -> Box<[SettingsPageItem]> { json_path: Some("edit_predictions.open_ai_compatible_api.model"), }), metadata: Some(Box::new(SettingsFieldMetadata { - placeholder: Some(OLLAMA_MODEL_PLACEHOLDER), + placeholder: Some(OPEN_AI_COMPATIBLE_MODEL_PLACEHOLDER), ..Default::default() })), files: USER,