-
Notifications
You must be signed in to change notification settings - Fork 2
Add Mistral AI backend support with abstraction layer #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ddulic
wants to merge
31
commits into
allenporter:main
Choose a base branch
from
ddulic:feat/mistral-ai-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a6d55b9
Add Mistral as an alternative AI backend
ddulic 098813a
Use Mistral dedicated OCR API and address code review suggestions
ddulic 50d84bf
Address Copilot PR review comments
ddulic 9b6aca5
Fix unused logger and test kwarg assertion
ddulic 8fb46cd
Address Copilot review: candidate zero-norm guard, Mistral tests, con…
ddulic cf75c77
Fix incorrect ocr_model value in concurrency test
ddulic 5a7e047
Update documentation to reflect Mistral AI backend support
ddulic 8977156
Guard against zero/negative max_concurrency to prevent semaphore dead…
ddulic 515e773
Remove unused config parameter from SummaryModule
ddulic 76c4b22
Address Copilot review: OCR robustness, compact JSON schema, config w…
ddulic 7d5899c
Fix mistralai v2 import, version constraint, and broken integration test
ddulic 6c2c9bc
Update uv.lock for mistralai>=2.0.0
ddulic 0aa2ab0
Use json.dumps for non-string generate_json content to ensure valid J…
ddulic df6936d
Add missing test coverage for Gemini, Mistral edge cases, embedding v…
ddulic ee6b4e8
Update docs to reflect provider-agnostic AI backend
ddulic ec2ec1f
Fix mypy lint errors in Gemini and Mistral services and tests
ddulic cdb725e
Change default ports from 8080/8081 to 8000/8001
ddulic c8df416
Address PR review comments
ddulic 1672069
Merge pull request #1 from ddulic/feat/mistral-ai-backend
ddulic 3fec311
Fix Dockerfile ports to match updated default (8080 -> 8000)
ddulic b67a6a3
Add Docker Compose example, fix README ports and broken server docs link
ddulic 7a94ee5
Fix GHCR image URL to allenporter/supernote, remove invalid JWT secre…
ddulic 0093665
Remove broken server README link
ddulic 8ec1b27
Merge pull request #2 from ddulic/fix/dockerfile-ports
ddulic e130588
Fix default port to match Dockerfile (8080 -> 8000)
ddulic 1161902
Fix ephemeral mode default port (8080 -> 8000)
ddulic 2d6dfec
Merge pull request #3 from ddulic/fix/dockerfile-ports
ddulic dac2004
fix(review): address PR #65 review comments
ddulic cfd26a7
fix(review): simplify concurrency clamping and guard zero-norm at ind…
ddulic de86fc1
fix(config): set gemini_chat_model default to gemini-3-flash-preview
ddulic 31b3a17
fix(review): restore gemini_ocr_module and mock_gemini_service names …
ddulic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| services: | ||
| supernote: | ||
| image: ghcr.io/allenporter/supernote:latest | ||
| # Alternatively, build from source: | ||
| # build: . | ||
| restart: unless-stopped | ||
| ports: | ||
| - "8080:8080" # Main server | ||
| - "8001:8001" # MCP server | ||
| volumes: | ||
| - supernote-data:/data | ||
| environment: | ||
| # AI Provider — set one of the following: | ||
| SUPERNOTE_GEMINI_API_KEY: "" # Google Gemini API key | ||
| # SUPERNOTE_MISTRAL_API_KEY: "" # Mistral AI API key (alternative) | ||
|
|
||
| # Storage & server | ||
| SUPERNOTE_STORAGE_DIR: /data | ||
| SUPERNOTE_CONFIG_DIR: /data/config | ||
| SUPERNOTE_HOST: 0.0.0.0 | ||
| SUPERNOTE_PORT: "8080" | ||
| SUPERNOTE_MCP_PORT: "8001" | ||
|
|
||
| # Optional: set the public-facing base URL (e.g. behind a reverse proxy) | ||
| # SUPERNOTE_BASE_URL: "https://supernote.example.com" | ||
| # SUPERNOTE_MCP_BASE_URL: "https://mcp.example.com" | ||
|
|
||
| # Optional: enable user self-registration | ||
| # SUPERNOTE_ENABLE_REGISTRATION: "true" | ||
|
|
||
| volumes: | ||
| supernote-data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was imaging that it would use different tasks names/columns for something like changing models to avoid the need to do this, hence why the tasks have specific names that include the models in them.
(You could have multiple modules if you want for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently:
With model-specific task/column names:
Downsides:
I see the benefit, when I did this, I wanted to avoid the need for a DB migration. I can proceed with this if you think it is the right approach. My logic was that people wouldn't be swapping providers often, and even if they do, a single re-indexing would be worth it to keep everything consistent.