-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: add new backend - MLX #7459
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b16b519
feat: support mlx plugin
louis-jan 023e5de
feat: add prompt cache and fix binary bundle
louis-jan 1482565
feat: vision support
louis-jan d01ec56
feat: detect vision capability while importing model
louis-jan 2816aea
fix: prompt cache
louis-jan 0d95371
feat: support mlx model download from hub
louis-jan b501b40
reactor: clean up settings
louis-jan 1a43a87
fix: add build step for darwin
louis-jan cb7a35a
feat: add local api server support for mlx model
louis-jan 9ed3007
fix: notarize mlx bin
Minh141120 5ed0bed
fix: simplify token speed counter
louis-jan 5d6b497
Merge pull request #7458 from janhq/fix/notarize-mlx-bin
Minh141120 ab80405
chore: clean up
louis-jan 53495a0
fix: linter
louis-jan a70aeee
fix: test
louis-jan 56b3af4
fix: ci fail
louis-jan f22f473
fix: xcode version
louis-jan 53fc576
fix: run target
louis-jan 172fc07
fix: xcode version
louis-jan 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 |
|---|---|---|
|
|
@@ -63,3 +63,6 @@ src-tauri/resources/ | |
| test-data | ||
| llm-docs | ||
| .claude/agents | ||
| mlx-server/.build | ||
| mlx-server/.swiftpm | ||
| .claude | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "name": "@janhq/mlx-extension", | ||
| "productName": "MLX Inference Engine", | ||
| "version": "1.0.0", | ||
| "description": "This extension enables MLX-Swift inference on Apple Silicon Macs", | ||
| "main": "dist/index.js", | ||
| "module": "dist/module.js", | ||
| "engine": "mlx", | ||
| "author": "Jan <service@jan.ai>", | ||
| "license": "AGPL-3.0", | ||
| "scripts": { | ||
| "build": "rolldown -c rolldown.config.mjs", | ||
| "build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install" | ||
| }, | ||
| "devDependencies": { | ||
| "cpx": "1.5.0", | ||
| "rimraf": "3.0.2", | ||
| "rolldown": "1.0.0-beta.1", | ||
| "typescript": "5.9.2" | ||
| }, | ||
| "dependencies": { | ||
| "@janhq/core": "../../core/package.tgz", | ||
| "@janhq/tauri-plugin-llamacpp-api": "link:../../src-tauri/plugins/tauri-plugin-llamacpp", | ||
| "@janhq/tauri-plugin-mlx-api": "link:../../src-tauri/plugins/tauri-plugin-mlx", | ||
| "@tauri-apps/api": "2.8.0", | ||
| "@tauri-apps/plugin-http": "2.5.0", | ||
| "@tauri-apps/plugin-log": "^2.6.0" | ||
| }, | ||
| "engines": { | ||
| "node": ">=18.0.0" | ||
| }, | ||
| "files": [ | ||
| "dist/*", | ||
| "package.json" | ||
| ], | ||
| "installConfig": { | ||
| "hoistingLimits": "workspaces" | ||
| }, | ||
| "packageManager": "yarn@4.5.3" | ||
| } |
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,21 @@ | ||
|
|
||
| import { defineConfig } from 'rolldown' | ||
| import pkgJson from './package.json' with { type: 'json' } | ||
| import settingJson from './settings.json' with { type: 'json' } | ||
|
|
||
| export default defineConfig({ | ||
| input: 'src/index.ts', | ||
| output: { | ||
| format: 'esm', | ||
| file: 'dist/index.js', | ||
| }, | ||
| platform: 'browser', | ||
| define: { | ||
| SETTINGS: JSON.stringify(settingJson), | ||
| ENGINE: JSON.stringify(pkgJson.engine), | ||
| IS_MAC: JSON.stringify(process.platform === 'darwin'), | ||
| }, | ||
| inject: process.env.IS_DEV ? {} : { | ||
| fetch: ['@tauri-apps/plugin-http', 'fetch'], | ||
| }, | ||
| }) |
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,28 @@ | ||
| [ | ||
| { | ||
| "key": "batch_size", | ||
| "title": "Batch Size", | ||
| "description": "Maximum number of concurrent requests to batch (0 = disabled)", | ||
| "controllerType": "input", | ||
| "controllerProps": { | ||
| "value": 4, | ||
| "placeholder": "4", | ||
| "type": "number", | ||
| "textAlign": "right" | ||
| } | ||
| }, | ||
| { | ||
| "key": "enable_continuous_batching", | ||
| "title": "Continuous Batching", | ||
| "description": "Enable continuous batching for higher throughput", | ||
| "controllerType": "checkbox", | ||
| "controllerProps": { "value": false } | ||
| }, | ||
| { | ||
| "key": "auto_unload", | ||
| "title": "Auto unload model", | ||
| "description": "Automatically unload other models when loading a new one", | ||
| "controllerType": "checkbox", | ||
| "controllerProps": { "value": true } | ||
| } | ||
| ] |
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,5 @@ | ||
| declare const SETTINGS: SettingComponentProps[] | ||
| declare const ENGINE: string | ||
| declare const IS_WINDOWS: boolean | ||
| declare const IS_MAC: boolean | ||
| declare const IS_LINUX: boolean |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.