Skip to content

Commit 2d382ef

Browse files
authored
Merge pull request #3 from SharpAI/feature/api-parity-roadmap
Feature/api parity roadmap
2 parents 689df93 + 4086ce9 commit 2d382ef

5 files changed

Lines changed: 1567 additions & 182 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, develop]
66
pull_request:
77
branches: [main]
88

@@ -15,6 +15,14 @@ jobs:
1515
- name: Install Metal Toolchain
1616
run: xcodebuild -downloadComponent MetalToolchain || true
1717

18+
- name: Cache Swift packages
19+
uses: actions/cache@v4
20+
with:
21+
path: .build
22+
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
23+
restore-keys: |
24+
${{ runner.os }}-spm-
25+
1826
- name: Resolve dependencies
1927
run: swift package resolve
2028

@@ -25,10 +33,3 @@ jobs:
2533
run: |
2634
ls -lh .build/release/mlx-server
2735
file .build/release/mlx-server
28-
29-
- name: Upload binary
30-
uses: actions/upload-artifact@v4
31-
with:
32-
name: mlx-server-arm64
33-
path: .build/release/mlx-server
34-
retention-days: 30

.github/workflows/e2e-test.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [main, feature/*]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: e2e-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
e2e:
15+
runs-on: macos-15
16+
timeout-minutes: 30
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Cache Swift packages
22+
uses: actions/cache@v4
23+
with:
24+
path: .build
25+
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
26+
restore-keys: |
27+
${{ runner.os }}-spm-
28+
29+
- name: Build (Release)
30+
run: swift build -c release
31+
32+
- name: Install MLX Metal library
33+
run: |
34+
python3 -m venv /tmp/mlx_venv
35+
/tmp/mlx_venv/bin/pip install --quiet mlx
36+
cp /tmp/mlx_venv/lib/python*/site-packages/mlx/lib/mlx.metallib .build/release/
37+
38+
- name: Cache MLX model
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/.cache/huggingface
42+
key: mlx-model-qwen2.5-0.5b-4bit
43+
44+
- name: Run E2E tests
45+
run: |
46+
chmod +x tests/test-server.sh
47+
tests/test-server.sh .build/release/mlx-server 15413
48+
49+
- name: Upload test logs on failure
50+
if: failure()
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: e2e-test-logs
54+
path: /tmp/mlx-server-test-*.log
55+
retention-days: 7

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ let package = Package(
2323
dependencies: [
2424
.product(name: "MLX", package: "mlx-swift"),
2525
.product(name: "MLXLLM", package: "mlx-swift-lm"),
26+
.product(name: "MLXVLM", package: "mlx-swift-lm"),
2627
.product(name: "MLXLMCommon", package: "mlx-swift-lm"),
2728
.product(name: "Transformers", package: "swift-transformers"),
2829
.product(name: "Hummingbird", package: "hummingbird"),

0 commit comments

Comments
 (0)