Skip to content
stefafafanPublic

About

An unofficial, provider-neutral Unix client for Jev from TypeSafe AI. Written in Go.

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

stefafafan/jev

An unofficial, provider-neutral Unix client for Jev from TypeSafe AI. Written in Go.

Currently supported providers:

  • TypeSafe AI
  • Cloudflare
  • Vercel

Installation

Install via go install:

go install github.com/stefafafan/jev@latest

or build from source:

go build -o jev .

GitHub Actions

Use stefafafan/setup-jev to install a released jev binary on a GitHub Actions runner.

- uses: stefafafan/setup-jev@ee163438b847a374ca9e4f44f08e376da69e2df9 # v1.0.0
  with:
    version: v0.1.1
- run: jev --version

For a working CI example, see this repository's pr-risk.yml workflow. It sends a pull request diff to Jev through Cloudflare and applies a corresponding merge-risk label.

Setup

Set credentials for your favorite provider:

export TYPESAFE_API_KEY=...

Then pipe state into one question:

echo "some state" | jev --provider typesafe noul "Is this safe?"

JSON is written by default:

{"provider":"typesafe","model":"jev-1.13.0","answers":{"result":{"type":"noul","noul":0.95}},"usage":{"input_tokens":392,"output_tokens":21}}

The CLI reports whether evaluation succeeded through its exit code. It does not turn a judgment into policy. Put thresholds downstream:

git diff | jev noul "Could this change introduce a regression?" | jq -e '.answers.result.noul < 0.2'

Questions

Each invocation asks exactly one question through a primitive subcommand.

Noul

cat incident.txt | jev noul "Does this require immediate action?"

Choice

Repeat --option for each candidate. Commas are ordinary label characters.

git diff |
  jev choice \
    --option safe \
    --option needs-review \
    --option unsafe \
    "How should this change be classified?"

Score

Score levels are ordered from low to high.

kubectl diff -f manifest.yaml |
  jev score \
    --level low \
    --level medium \
    --level high \
    "How risky is this deployment?"

State

State always comes from stdin. Use ordinary shell redirection for a file:

jev noul "Is this urgent?" < incident.txt

Providers

The CLI supports TypeSafe AI, Cloudflare Workers AI, and Vercel AI Gateway.

TypeSafe AI

export TYPESAFE_API_KEY=...
cat input.txt | jev --provider typesafe noul "Is this safe?"

Cloudflare

export CLOUDFLARE_API_TOKEN=...
export CLOUDFLARE_ACCOUNT_ID=...
cat input.txt | jev --provider cloudflare noul "Is this safe?"

Vercel

export AI_GATEWAY_API_KEY=...
cat input.txt | jev --provider vercel noul "Is this safe?"

Output

JSON is the default machine-readable format.

Each answer retains the Jev primitive fields:

  • Noul: type, noul
  • Choice: type, choice, confidence, probabilities
  • Score: type, score, confidence, legend, probabilities

Use --output text option as needed.

cat input.txt | jev --output text noul "Is this safe?"

stdout contains only a successful result. Diagnostics are written to stderr.

Options

jev [global options] noul QUESTION
jev [global options] choice --option LABEL --option LABEL [...] QUESTION
jev [global options] score --level LEVEL --level LEVEL [...] QUESTION

--provider NAME  provider: typesafe, cloudflare, or vercel
--output FORMAT  json (default) or text
--version        show version
-h, --help       show help

About

An unofficial, provider-neutral Unix client for Jev from TypeSafe AI. Written in Go.

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages