jev README

The project's README from github.com/feder-cr/jev. As one markdown file: README.md.

jevos-1b

Yes/no decisions on a laptop CPU in 50–220 ms. Send a text and a yes/no question, get back P(yes).

jevos-1b playing a Chrome Dino-style game on the CPU, answering two yes/no questions per step (recording at 2× speed)

Benchmarks

Latency on a short request: jevos-1b 54 ms, Jev 344 ms, Laya 104 ms. On a long request: jevos-1b 220 ms, Jev 345 ms, Laya 449 ms. Accuracy on 2,000 yes/no questions from unseen policies: jevos-1b 0.815, Jev 0.927, Laya 0.489

What each one does

jevos-1b Jev Laya
Yes/no questions ✓ ✓ ✓
Multiple choice Soon ✓ ✓
Scores Soon ✓ ✓
Runs on your machine cloud your machine
Cost free per token free
Context 8,192 tokens not stated 512 tokens

Quickstart

Download jevos-1b-q4_k_m.gguf from the release, then:

uv sync
uv run jev download --only runtime        # llama.cpp for this machine
uv run jev serve --gguf jevos-1b-q4_k_m.gguf --device cpu --threads 16
curl http://127.0.0.1:8017/v1/systemone -H 'Content-Type: application/json' -d '{
  "model": "jev-latest",
  "state": "I was charged twice for the same order.",
  "questions": {"billing": {"type": "noul", "instructions": "Is this a billing problem?"}}}'
{
  "model": "jevos-1b-q4_k_m",
  "answers": {"billing": {"type": "noul", "noul": 0.9}},
  "usage": {"input_tokens": 27, "output_tokens": 0}
}

Then open http://127.0.0.1:8017/dino to watch it play.

API

The server speaks TypeSafe Jev's wire format, so code written for Jev's SDK works unchanged for yes/no questions.

POST /v1/systemone

Field What it is
model jev-latest (any jev-* name works) or the served model's name
state the text to decide on: a string, or any JSON object or array
questions one or more named questions, each {"type": "noul", "instructions": "…?"}

Every answer is noul, the probability that the answer is yes (0 to 1). Questions in the same request share the state, which is read once: the three questions below take about 165 ms together, against 103 ms for one of them alone.

{
  "model": "jev-latest",
  "state": {
    "item": "wireless mouse",
    "delivered": "5 days ago",
    "customer_message": "The box arrived empty. This is the second time!"
  },
  "questions": {
    "refund": {
      "type": "noul",
      "instructions": "Our policy refunds items reported missing within 30 days of delivery. Should this customer get a refund?"
    },
    "upset": {"type": "noul", "instructions": "Is the customer upset?"},
    "wrong_item": {"type": "noul", "instructions": "Does the customer say they received the wrong item?"}
  }
}
{
  "model": "jevos-1b-q4_k_m",
  "answers": {
    "refund": {"type": "noul", "noul": 0.78},
    "upset": {"type": "noul", "noul": 0.73},
    "wrong_item": {"type": "noul", "noul": 0.1}
  },
  "usage": {"input_tokens": 95, "output_tokens": 0}
}

Other endpoints

Endpoint Returns
GET /v1/models the served model and its jev-latest alias
GET /health {"status": "ready", …} once the model is loaded

From Python

import requests

answer = requests.post("http://127.0.0.1:8017/v1/systemone", json={
    "model": "jev-latest",
    "state": "I was charged twice for the same order.",
    "questions": {"billing": {"type": "noul", "instructions": "Is this a billing problem?"}},
}).json()

if answer["answers"]["billing"]["noul"] > 0.5:
    print("send to billing")

Server options

Option Default
--gguf path to the model file
--device auto cpu to stay on the CPU
--threads 4 CPU threads; set it to your core count, fewer if other heavy apps are running
--host, --port 127.0.0.1, 8017 where the server listens

Credits

Built together with Loris Salsi (@LosaLosSantos).

jev (feder-cr/jev)

Searching Database…

1.4K ·GitHub
Что это?jevos-1b — это бесплатный движок принятия решений «да/нет» с открытым исходным кодом, который работает локально на процессоре вашего ноутбука и примерно за 50–220 мс возвращает вероятность того, что ответом на заданный текст с вопросом будет «да»; это self-hosted-альтернатива облачному сервису Jev.
Это библиотека, которую я импортирую, или сервер, который я запускаю?Это отдельный HTTP-сервер с эндпоинтом POST /v1/systemone, который использует тот же формат обмена данными, что и SDK Jev, поэтому существующий клиентский код для Jev работает с ним без изменений.
Как его запустить?Скачайте файл модели jevos-1b-q4km.gguf из GitHub-релиза проекта, затем запустите сервер с флагом --gguf, указывающим на этот файл.
Умеет ли он отвечать на вопросы с вариантами или с оценкой, а не только да/нет?Пока нет — сегодня работают только вопросы «да/нет» (noul); вопрос с вариантами или с оценкой отклоняется ошибкой 422, хотя оба типа помечены в дорожной карте как «Soon».
Мой текст отправляется на облачный сервер?Нет — в отличие от Jev, который работает в облаке, jevos-1b (как и Laya) работает целиком на вашей машине, так что с вашего компьютера ничего не уходит.
Как jevos-1b смотрится на фоне настоящего сервиса Jev?На вопросах «да/нет» он не уступает Jev, при этом бесплатен и офлайновый вместо оплаты за токен и облачного хостинга, но пока не поддерживает вопросы с вариантами или с оценкой, которые в Jev уже есть.
Какая модель на самом деле работает под капотом?Это модель на основе MiniCPM, поставляемая как квантованный GGUF-файл (jevos-1b-q4km.gguf) и обслуживаемая через инференс на CPU в стиле llama.cpp.
Можно задать несколько вопросов к одному тексту за раз?Да — один запрос может нести несколько именованных вопросов с общим состоянием, которое читается только один раз, поэтому три вопроса вместе занимают около 165 мс против 103 мс для одного.
Что можно положить в поле «state» помимо обычного текста?Состоянием может быть обычная строка или любой JSON-объект или массив; модель читает его один раз и отвечает на каждый вопрос запроса, опираясь на него.
Creator
feder-cr
Size
17.6 MB
Stars
1.4K
Age
2y
Commits · 90 Days