Skip to content

Commit 87eae49

Browse files
authored
Merge pull request #9 from joonsoome/rerank-model-use-update
feat: v1.5.0 — MLX Reranker, OpenAI rerank path, macOS service, 2560‑D embeddings
2 parents 832eead + e016213 commit 87eae49

24 files changed

+1886
-734
lines changed

.env.example

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ MODEL_NAME=mlx-community/Qwen3-Embedding-4B-4bit-DWQ
88
MODEL_PATH=
99
CROSS_ENCODER_MODEL=
1010

11+
# Reranker (Cross-Encoder) — Optional
12+
# Choose one of the following ways to enable reranking:
13+
# 1) Torch CrossEncoder (sentence-transformers)
14+
# RERANKER_BACKEND=torch
15+
# CROSS_ENCODER_MODEL=cross-encoder/ms-marco-MiniLM-L-6-v2
16+
#
17+
# 2) MLX Reranker (experimental v1; pooled token embeddings + linear head)
18+
# RERANKER_BACKEND=mlx
19+
# RERANKER_MODEL_ID=vserifsaglam/Qwen3-Reranker-4B-4bit-MLX
20+
#
21+
# Auto selection prefers Torch for stability (set RERANKER_BACKEND=auto)
22+
RERANKER_BACKEND=auto
23+
RERANKER_MODEL_ID=
24+
# Alias for convenience; same as RERANKER_MODEL_ID
25+
RERANKER_MODEL_NAME=
26+
# Optional overrides
27+
RERANK_MAX_SEQ_LEN=512
28+
RERANK_BATCH_SIZE=16
29+
# MLX-only experimental options:
30+
# - RERANK_POOLING: mean | cls (default: mean)
31+
# - RERANK_SCORE_NORM: none | sigmoid | minmax (default: none)
32+
# Use sigmoid to bound scores to [0,1] for schema-constrained clients.
33+
RERANK_POOLING=mean
34+
RERANK_SCORE_NORM=none
35+
36+
# OpenAI compatibility (scores normalization on native path for OpenAI clients)
37+
# true | false (default true)
38+
OPENAI_RERANK_AUTO_SIGMOID=true
39+
1140
# Model Cache & Storage
1241
# MODEL_PATH: Custom path for MLX models (overrides auto cache detection)
1342
# If empty, uses Hugging Face cache or environment variables below:

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-publish:
11+
name: Build and publish Python package
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: read
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.13"
25+
26+
- name: Install build tools
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install build
30+
31+
- name: Build sdist and wheel
32+
run: python -m build
33+
34+
- name: Publish to PyPI
35+
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
36+
uses: pypa/gh-action-pypi-publish@v1.12.4
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}
40+
skip-existing: true

0 commit comments

Comments
 (0)