Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: /messages support for mlx server

Louis8d66168e38f4
diff --git a/src-tauri/src/core/server/proxy.rs b/src-tauri/src/core/server/proxy.rs
index 02ff9050c..0e5a31779 100644
--- a/src-tauri/src/core/server/proxy.rs
+++ b/src-tauri/src/core/server/proxy.rs
@@ -1327,8 +1327,6 @@ async fn proxy_request<R: tauri::Runtime>(
// For Anthropic /messages, we need to track if we should transform the response
let destination_path = path.clone();
- // Track if it's an Anthropic request with a remote provider
- let is_anthropic_remote = is_anthropic_messages && provider_name.is_some();
match outbound_req_with_body.send().await {
Ok(response) => {
@@ -1336,9 +1334,9 @@ async fn proxy_request<R: tauri::Runtime>(
let is_error = !status.is_success();
- // For Anthropic /messages requests with errors, try /chat/completions on same provider
- if is_anthropic_remote && is_error {
- log::warn!("Remote provider failed for /messages with status {status}, trying /chat/completions...");
+ // For Anthropic /messages requests with errors, try /chat/completions
+ if is_error {
+ log::warn!("Request failed for /messages with status {status}, trying /chat/completions...");
// Clone what we need for the fallback request
let fallback_url = target_base_url.clone().map(|url| {