Skip to content

jgrep

grep where the pattern is a description: each line, record, function or diff hunk becomes a streamed Jev yes/no question.

LibrarybetaMIT

Overview

jgrep (keltokhy) filters input by meaning. Each line becomes one yes/no question to Jev, which returns a probability in about 200 ms for about a thousandth of a cent. Lines are read as they arrive, judged concurrently and printed in input order, so it works on tail -f as well as files; an option prints the probability per line. Beyond plain lines, it can judge structured records, Python, Go and C functions and unified diff hunks.

The README reports 994 Hacker News titles judged in 4.6 seconds for $0.012, with three descriptions taking the same time as one. It works with a TypeSafe or OpenRouter key, any gateway that serves the System One format, or experimental local servers such as Laya, GLiNER-based or DiffusionGemma System One servers, in which case nothing leaves the machine. It installs with uv as jev-grep. It suits log watching, triage and quick semantic filtering in shell pipelines.

What the decision model decides

TypeQuestionAnswers
Yes / noDoes this line match the description (e.g. a user is getting frustrated)?—
Yes / noDoes this function or diff hunk match the description?—

How it works

  1. Pipe lines or files into jgrep with a description
  2. Each line, record, function or hunk becomes a yes/no question
  3. Requests run concurrently against the chosen backend
  4. Matches print in input order, optionally with probabilities

Strengths

  • Streams on tail -f
  • Several descriptions at once at the same latency
  • Multiple backends including local servers
  • Very low cost per line

Caveats

  • Lines are judged independently, without surrounding context
  • Hosted backends receive the text
  • Local server support is experimental

Getting started

uv tool install jev-grep, set TYPESAFE_API_KEY or OPENROUTER_API_KEY, then tail -f app.log | jgrep "a user is getting frustrated".

At a glance

Type
Library
Status
beta
Language
Python
Runtime
CLI
Has code
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • Data filtering: filters text, structured records, functions, and diff hunks against plain-English descriptions using Jev Noul judgments.

    yibie/awesome-jev
  • Filters text, structured records, functions, and diff hunks against plain-English descriptions using Jev Noul judgments.

    logicrw/awesome-jev-projects
  • grep, but the pattern is a description.

    wh000wh000/awesome-jev-live
  • Grep, but the pattern is a description. Filters lines by meaning with TypeSafe's Jev decision model: ~200 ms and a thousandth of a cent per line.

    hellogumbo/awesome-jev
  • Like grep, but the pattern is a description: it filters piped output as well as files and prints a probability per line.

    MrJev/awesome-jev

Frequently asked questions

How fast is it?

About 200 ms per line, run concurrently; 994 titles took 4.6 seconds in the README's test.

Can it run offline?

Yes, with an experimental local System One server such as Laya.

How is it different from jgrep by kyu1204?

That one targets code chunks and CI gating; this one is a general line and record filter.

Related projects

  • Unix filters (grev, tagv, rank, sortv, cutv, uniqv and more) that select, label and rank lines by meaning with Jev.

    CLIbetaGo
  • Unix filter CLI that pipes files, lines or records to Jev for bulk yes/no, choice or score judgments so agents need not read everything.

    ProjectbetaPython
  • CLI that searches code, docs and logs by natural-language condition, asking Jev a yes/no question per candidate with a threshold.

    CLIbetaTypeScript
  • Pi codemode tool that classifies whole project files with caller-defined Jev questions, returning paths and typed answers, not source.

    AppbetaTypeScript
  • dbt package whose macros run Jev Choice, Noul and Score over SQL values in DuckDB and ClickHouse models.

    ProjectbetaSQL (Jinja)
  • DuckDB extension that asks Jev about every row in SQL and returns answers as ENUM, DOUBLE or STRUCT columns.

    PluginbetaC++