jina-grep: Adding Semantic Search Capabilities to Grep on Apple Silicon
Jina-grep is an open-source CLI that adds fast, MLX-powered semantic search to grep on Apple Silicon, offering three modes, sub-millisecond latency, high token throughput, and easy installation, making local code and log searching more accurate than keyword matching.
jina-grep is an open‑source command‑line tool that adds semantic search to traditional grep on Apple Silicon by executing MLX models locally, eliminating the need for external vector‑database services.
Working Modes
Pipeline mode : pipes the output of grep into jina-grep for semantic re‑ranking.
grep -rn "error" src/ | jina-grep "错误处理逻辑"Standalone mode : performs natural‑language search directly over files. jina-grep "内存泄漏" src/ Zero‑shot classification : assigns the most relevant label to each line of text.
jina-grep -e "数据库" -e "错误处理" -e "数据处理" src/Performance on Apple M3 Ultra
v5‑small model (677 M parameters): single‑query latency 7 ms, peak throughput 25.3 K tokens / s.
v5‑nano model (239 M parameters): single‑query latency 2.9 ms, peak throughput 98.7 K tokens / s.
Technical Details
The project is built entirely on the MLX framework and does not depend on PyTorch or the transformers library. Model checkpoints are fetched on demand from HuggingFace, and the tool supports automatic batching of up to 256 inputs per request. A lightweight server runs in the background and is invoked through the CLI.
Installation
git clone https://github.com/jina-ai/jina-grep-cli.git && cd jina-grep-cli
uv venv .venv && source .venv/bin/activate
uv pip install -e .Requirements: Python 3.10+, Apple Silicon Mac, Apache‑2.0 license.
Real‑World Example
Developers report that the tool can replace roughly half of existing search workflows. For instance, locating code that implements an "exponential backoff retry mechanism" traditionally requires exact keyword matches; jina-grep can retrieve semantically similar implementations even when the exact phrase is absent.
Repository
https://github.com/jina-ai/jina-grep-cli
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
AI Engineering
Focused on cutting‑edge product and technology information and practical experience sharing in the AI field (large models, MLOps/LLMOps, AI application development, AI infrastructure).
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
