Skip to main content

semgrepll - Local Semantic Code Search

semgrepll demo

PyPI License: MIT GitHub stars

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.

Metadata

Release files for semgrepll 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semgrepll 1.3.1
File Size Uploaded
semgrepll-1.3.1.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for semgrepll 1.3.1
File Interpreter ABI Platform
semgrepll-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / semgrepll-1.3.1.tar.gz

Download URL semgrepll-1.3.1.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ec7d8d5b085e514318f7a9a484f334c0aa45fc8e584fedbb331263f79f7684cf
BLAKE2b-256 checksum
How to use checksums
60a4dad1dafa3853d2f510bff7ce8a816d535ff1f3abbb029937bd32f362c9e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / semgrepll-1.3.1-py3-none-any.whl

Download URL semgrepll-1.3.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d6e06f7feb4c34af098a1a30d0cdecc27ecf3f24ef22815f1c17718d3c75b5b
BLAKE2b-256 checksum
How to use checksums
bdc2038c772a44384c5be28b608fde93c26359a326cbef71ec452bee1956d1b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page