Support OpenAI-compatible inference endpoints

This commit is contained in:
Mark Gregory
2026-11-16 13:58:43 +00:00
parent afeba270f4
commit caa0a8733b
9 changed files with 309 additions and 30 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ Native SwiftUI chat for Apple silicon Macs running macOS 14 or later. Open `AISt
## 1. Set up a model
- **Ollama:** In **Settings → Models**, refresh the installed list and select a tag. The default server is `http://127.0.0.1:11434`. Use the same pane to pull, inspect, and delete models. Enter a remote HTTP or HTTPS base URL to use another server. The optional bearer token stays in memory and requires HTTPS for remote servers.
- **OpenAI-compatible:** In **Settings → Models**, choose the compatible backend, enter the API base URL (for example `http://127.0.0.1:1234/v1` for LM Studio), then refresh models and select the exact model ID. Remote URLs require HTTPS. An optional bearer token stays in memory and is cleared when the endpoint changes. The server manages model loading. Chat Completions streams the reply and any separately reported reasoning.
- **MLX:** In **Settings → MLX Catalog**, download and select a pinned SmolLM2 or Qwen3 model. **Settings → Models** also accepts a local model folder with configuration, tokenizer files, and safetensors weights. **Use Model** selects on-device inference. **Prefer Ollama** can fall back to the configured MLX folder when Ollama fails before emitting output.
- **Thinking:** The composer sends Boolean or named effort settings to Ollama. Supported MLX templates expose Default, Off, and On. Reported reasoning appears in an expandable section. If an Ollama request is interrupted after emitting text, reasoning, or a tool call, the router keeps that backend. **Stop** cancels generation and retains any partial output.
@@ -41,7 +42,7 @@ Parameters**. Blank fields inherit backend defaults, including AI Studio’s
1,024-token MLX cap. Shared settings include sampling temperature, top-p,
output token limit, repetition controls, and stop sequences. Ollama also accepts
context length, top-k, min-p, seed, frequency and presence penalties, keep-alive,
and JSON response mode. Native MLX exposes rolling KV-cache size and prefill
and JSON response mode. The compatible backend sends temperature, top-p, max tokens, stops, frequency and presence penalties, and JSON mode. Native MLX exposes rolling KV-cache size and prefill
step size. On failover, MLX uses the supported shared and MLX settings.
**Settings → Local Tools** runs a confirmed command through the installed