Local semantic code search - multi-backend (llama.cpp, HF API, ONNX, Ollama)
Project description
semgrepll - Local Semantic Code Search
Local semantic grep using embeddings - 100% offline capable.
Features
- Multi-backend support: llama.cpp, ONNX, Ollama
- Auto-detection: Automatically picks fastest available local backend
- Hybrid storage: SQLite (small projects) or LanceDB (large)
- 100% offline: No external connections
- Embedding caching: Fast re-indexing
- Semantic search: Find code by meaning, not just keywords
Backends (priority order)
| Rank | Backend | Speed | Notes |
|---|---|---|---|
| 1 | llama.cpp | ~1s | Fastest - requires GGUF model |
| 2 | ONNX | ~3s | Local - uses HF model files |
| 3 | Ollama | ~6s | Local server fallback |
Installation
pip install semgrepll
# Optional: ONNX backend support
pip install semgrepll[onnx]
Usage
# Index a project (auto-detects backend)
semgrep index /path/to/project
# Search semantically
semgrep search "authentication logic"
# List indexed projects
semgrep ls
Environment Variables
| Variable | Description | Default |
|---|---|---|
EMBED_BACKEND |
Backend: auto, llama, onnx, ollama | auto |
EMBED_MODEL |
Model name | mxbai-embed-large-v1 |
LLM_MODEL_PATH |
Path to GGUF model (for llama.cpp) | - |
ONNX_MODEL_PATH |
Path to ONNX model | auto-detect |
SEMGREP_BACKEND |
Storage: auto, sqlite, lance | auto |
Benchmark
| Backend | Speed |
|---|---|
| llama.cpp | ~1s |
| ONNX | ~3s |
| Ollama | ~6s |
License
MIT License - see LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
semgrepll-1.3.1.tar.gz
(13.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
semgrepll-1.3.1-py3-none-any.whl
(12.7 kB
view details)
File details
Details for the file semgrepll-1.3.1.tar.gz.
File metadata
- Download URL: semgrepll-1.3.1.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec7d8d5b085e514318f7a9a484f334c0aa45fc8e584fedbb331263f79f7684cf
|
|
| MD5 |
d83711c28c8072749ad35bbe0b3c3708
|
|
| BLAKE2b-256 |
60a4dad1dafa3853d2f510bff7ce8a816d535ff1f3abbb029937bd32f362c9e1
|
File details
Details for the file semgrepll-1.3.1-py3-none-any.whl.
File metadata
- Download URL: semgrepll-1.3.1-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d6e06f7feb4c34af098a1a30d0cdecc27ecf3f24ef22815f1c17718d3c75b5b
|
|
| MD5 |
7730e7fbd1281e408915ec6e0245d81f
|
|
| BLAKE2b-256 |
bdc2038c772a44384c5be28b608fde93c26359a326cbef71ec452bee1956d1b6
|