feat: add first-class oMLX provider via Esperanto profile - #1164
Conversation
f14d6eb to
5fc520d
Compare
There was a problem hiding this comment.
2 issues found and verified against the latest diff
Confidence score: 5/5
- In
docs/4-AI-PROVIDERS/index.md, the Setup Guide link pattern is inconsistent with other providers, so users may be sent to a less comparable destination and miss the expected anchor-based context—update this link to the sameai-providers.mdanchor style before merging. - In
.env.example, presentingOLLAMA_API_BASEwithout a deprecation cue can nudge users toward the legacy env-var setup, creating avoidable configuration confusion—add a short deprecation note (or remove the example entry) to align with the Settings UI guidance before merging.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/4-AI-PROVIDERS/index.md">
<violation number="1" location="docs/4-AI-PROVIDERS/index.md:95">
P3: This entry's 'Setup Guide' link breaks the pattern used by all other providers in this comparison table, which point to an anchor within ai-providers.md rather than the standalone provider doc. Consider linking to `../5-CONFIGURATION/ai-providers.md#omlx-apple-silicon` for consistency, or updating the pattern intentionally across the file.</violation>
</file>
<file name=".env.example">
<violation number="1" location=".env.example:51">
P3: OLLAMA_API_BASE is documented as deprecated in favor of the Settings UI, but this example line presents it without any deprecation note, which could steer users toward the legacy env-var flow.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| - Best for: macOS Apple Silicon, private local inference | ||
| - Privacy: 100% local; default URL `http://localhost:11435/v1` (avoids SurrealDB on 8000) | ||
|
|
||
| → [Setup Guide](../5-CONFIGURATION/omlx.md) |
There was a problem hiding this comment.
P3: This entry's 'Setup Guide' link breaks the pattern used by all other providers in this comparison table, which point to an anchor within ai-providers.md rather than the standalone provider doc. Consider linking to ../5-CONFIGURATION/ai-providers.md#omlx-apple-silicon for consistency, or updating the pattern intentionally across the file.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/4-AI-PROVIDERS/index.md, line 96:
<comment>This entry's 'Setup Guide' link breaks the pattern used by all other providers in this comparison table, which point to an anchor within ai-providers.md rather than the standalone provider doc. Consider linking to `../5-CONFIGURATION/ai-providers.md#omlx-apple-silicon` for consistency, or updating the pattern intentionally across the file.</comment>
<file context>
@@ -84,6 +84,17 @@ Open Notebook supports 17+ AI providers. This guide helps you **choose the right
+- Privacy: 100% local
+- Note: Default port 8000 conflicts with SurrealDB — use `11435`
+
+→ [Setup Guide](../5-CONFIGURATION/omlx.md)
+
**LM Studio (Alternative)**
</file context>
| → [Setup Guide](../5-CONFIGURATION/omlx.md) | |
| → [Setup Guide](../5-CONFIGURATION/ai-providers.md#omlx-apple-silicon) |
| @@ -50,6 +50,10 @@ SURREAL_DATABASE=open_notebook | |||
| # Ollama endpoint (if running locally) | |||
| # OLLAMA_API_BASE=http://localhost:11434 | |||
There was a problem hiding this comment.
P3: OLLAMA_API_BASE is documented as deprecated in favor of the Settings UI, but this example line presents it without any deprecation note, which could steer users toward the legacy env-var flow.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .env.example, line 51:
<comment>OLLAMA_API_BASE is documented as deprecated in favor of the Settings UI, but this example line presents it without any deprecation note, which could steer users toward the legacy env-var flow.</comment>
<file context>
@@ -48,7 +48,11 @@ SURREAL_DATABASE=open_notebook
# Ollama endpoint (if running locally)
-# OLLAMA_BASE_URL=http://ollama:11434
+# OLLAMA_API_BASE=http://localhost:11434
+
+# oMLX endpoint (Apple Silicon MLX server; avoid port 8000 — SurrealDB)
</file context>
CI failure fixFailing job: Cause: Esperanto is git-pinned ( Backend Lint / Tests / Typecheck and Frontend checks were already green — only the Docker build failed. Fix: Install Local evidence (same failing step)Rebuild of |
Expose Esperanto's built-in omlx OpenAICompatibleProfile in Settings with Ollama-style UX (default http://localhost:11435/v1, optional API key, language+embedding discovery). No openai-compatible remapping or OPENAI_COMPATIBLE_* env mirroring. Fixes lfnovo#1048
17b39c0 to
2234ef0
Compare
|
Heads-up: I rebased this branch onto |
# Conflicts: # CHANGELOG.md
Description
Adds first-class oMLX provider support in Settings, following the direction settled on #1048 after Esperanto upstream landed (lfnovo/esperanto#228 / PR #239).
Open Notebook exposes the native Esperanto provider name
omlx(built-inOpenAICompatibleProfile). There is no remapping toopenai-compatibleand noOPENAI_COMPATIBLE_*env mirroring (the approach rejected in closed #1049).provider_registry(frontend consumesGET /api/providers)http://localhost:11435/v1(avoids SurrealDB on8000)/v1/modelsdiscovery with existingprepare_pinned_http_targetSSRF helpers (fix: pin DNS for outbound provider HTTP requests #1063)docs/5-CONFIGURATION/omlx.md+ cross-linksIssue status: #1048 is open, labels
enhancement/area: providers/upstream/esperanto, unassigned. This PR implements the thin Open Notebook exposure now that upstream is done.Esperanto dependency: oMLX is merged to Esperanto
mainbut not yet on PyPI (latest release still2.24.0). This PR pins Esperanto to merge commitcf319506of #239 until a release ships; happy to switch toesperanto>=2.25.0(or whatever tag) as soon as it is published.Related Issue
Fixes #1048
Supersedes closed #1049 (wrong approach: Open Notebook remapping).
Type of Change
How Has This Been Tested?
uv run pytest)Test Details:
Design Alignment
Which design principles does this PR support? (See VISION.md)
Explanation:
Local Apple Silicon inference stays on-device (privacy). Identity lives in Esperanto’s profile mechanism (extensibility through standards) rather than Open Notebook-only aliases, matching DeepSeek/xAI/DashScope.
Where it differs from traditional HTTP server based inference tools like Ollama is that oMLX cannot be run directly under a Docker environment.
Checklist
Code Quality
Testing
make rufforruff check . --fixmake lintoruv run python -m mypy .Documentation
/docs(if applicable)Database Changes
/migrations)Breaking Changes
Screenshots (if applicable)
N/A (provider wiring + docs; Settings entry comes from registry /
GET /api/providers)Additional Context
Key wiring (no remapping):
open_notebook/ai/provider_registry.py—omlxProviderSpecapi/models.py—SupportedProviderLiteralopen_notebook/ai/key_provider.py—OMLX_API_KEY+OMLX_API_BASEvia simple provision (notOPENAI_COMPATIBLE_*)api/credentials_service.py— connection test +discover_with_configopen_notebook/ai/model_discovery.py—discover_omlx_modelsModelManageralready passes provideromlxthrough toAIFactoryafter underscore→hyphen normalize (no-op foromlx)Pre-Submission Verification