feat(lemonade): native Lemonade server integration#8319
Conversation
PR Review: feat(lemonade) — native Lemonade server integrationThis PR adds Lemonade (a local AMD/llama.cpp inference server) as a first-class built-in provider alongside llamacpp and mlx. It wires up automatic model discovery via the What's good
Concerns / issues to address1. In 2. Duplicated MCP URL construction logic The base-URL-change handler and the 3. The 4. The function 5. The provider detail component skips rendering the 6. Missing auto-catalog trigger for Lemonade on initial load The 7. Minor: The diff removes a stale Summary table
Recommendation: improve needed |
eb3632b to
5197389
Compare
|
Addressed in the latest commit:
Finding 5 (api-key field hidden): The field is actually already visible for Lemonade — the condition returns |
5197389 to
bcfa3ec
Compare
|
Updated to ensure model's context size flows through to Jan. |
Follow-up Review — All feedback addressedRe-reviewing after author's updates (Jun 18-19 comments). Previous review items — status
Additional improvementThe author added context length flow-through in Test coverageComprehensive tests added:
Recommendation: can mergeAll 7 review items resolved. Code follows existing provider extension patterns consistently. Test coverage is thorough. The additional context-length improvement is a quality enhancement. No remaining blockers. |
|
@qnixsynapse would be awesome to get your take on this. I was not sure what the general policy around new providers are. This would really help folks using self hosted models via Lemonade. Especially the label syncing and mcp. I am happy to field any review feedback you might have. |
|
@abn Wouldn't custom providers using the |
|
Since it has OpenAI compatible endpoints in addition to others, yes it will technically work as a custom addition. The biggest motivation for having this as a first-class provider is the ability to auto sync capabilities like tool, vision etc. It is a bitt challenging to go do that manually for all the available models and new ones that get added etc 😅. Especially since (like in the example) quite a lot might be available. This bit me when I was attempt to use the browser mcp, as it needed the models to be configured as being vision capable. I had to do this manually before every switch. The other aspects that I believe make the case are the ability to switch wire protocol and also the integration of the MCP server as a native feature. Hope that helps clarify your question. |
Follow-up Review -- Architectural discussion (built-in vs custom provider)Catching up on the maintainer discussion between @abn and @qnixsynapse since our last review. The question: could the custom providers
|
| Capability | Custom provider + |
First-class integration |
|---|---|---|
| Basic chat completions | Yes | Yes |
Auto-discover models from /v1/models |
Yes (generic fetch) | Yes, with capability inference (vision, tools, audio parsed from Lemonade's label taxonomy) |
| Wire-format switching (OpenAI / Anthropic) | No -- custom providers are OpenAI-only | Yes -- api-format setting toggles api_type |
| MCP gateway registration | No -- requires custom UI toggle and useMCPServers integration |
Yes -- one-click toggle per project |
| Context length flow-through | Partial -- user must set manually per model | Yes -- auto-read from server metadata |
| Capability-gated features (e.g., browser MCP needing vision) | No -- user must manually flag each model | Yes -- inferred automatically from labels |
The auto-capability-inference point is the strongest argument. As @abn noted, without it a user has to manually mark every model as vision/tool-capable before features like browser MCP work, and redo that configuration on every model switch. That is a meaningful UX gap.
Trade-offs for the Jan team
In favor of merging:
- The implementation follows existing provider patterns faithfully (same extension points as llamacpp/mlx)
- Maintenance surface is modest: ~690 lines added across 16 files, with good test coverage
- Lemonade is an active open-source project with a stable API surface
- The MCP gateway integration is genuinely novel -- no other built-in provider offers this
Arguments for caution:
- Each built-in provider is a long-term maintenance commitment (API changes, bug reports, docs updates)
- If this sets a precedent, other local inference servers (Ollama, vLLM, LocalAI, etc.) may request similar treatment
- The Jan team would need to decide on a policy for when a provider "earns" first-class status vs using the custom
+flow
Code quality assessment
Regardless of the architectural decision, the implementation quality is solid:
- All 7 items from our initial review were addressed
- Test coverage is comprehensive (unit tests for capability inference, provider classification, MCP toggle, URL construction)
- The
lemonadeMcpUrlhelper extraction andKEY_OPTIONAL_PROVIDERSSet pattern improved code structure beyond the original submission - Context length flow-through was added as a bonus improvement
- No new commits since our last review on June 19 -- the code is stable
No new commits
The head SHA remains bcfa3ec0 (last amended June 19). No additional code changes since our "can merge" review.
Recommendation: can merge (from a code quality standpoint)
The code is clean, well-tested, and follows established patterns. The outstanding question is purely architectural -- whether the Jan team wants to accept a new built-in provider. That decision is @qnixsynapse's (and the broader team's) call based on their provider policy. From a technical review perspective, this is ready.
|
@qnixsynapse wanted to check-in to see if you had any further thoughts on this. It would definitely be a huge quality of life improvement for Lemonade users. |
Adds Lemonade as a built-in model provider for local AI inference. Models and their capabilities (vision, tools, audio) are discovered automatically from the running server. Supports both OpenAI and Anthropic wire formats, and optionally registers Lemonade's MCP gateway per project.
bcfa3ec to
82abe56
Compare
Describe Your Changes
Adds Lemonade as a built-in model provider for local AI inference. Models and their capabilities (vision, tools, audio) are discovered automatically from the running server. Supports both OpenAI and Anthropic wire formats, and optionally registers Lemonade's MCP gateway per project.
Screencast.From.2026-06-18.02-08-25.mp4
PS: Hope this is a welcome addition, happy to field any review comments.
Self Checklist
Created issues for follow-up changes or refactoring needed(N/A)