Skip to main content

SelfJev

SelfJev turns text, images and questions into decisions your code can use. Route a request, check an AI response, or apply a policy. Get typed answers and probabilities back from selfjev-4b, an open 4B decisions model with Jev's API.

SelfJev is self-hosted. There is no SelfJev cloud: you run the model server on your own GPU, and this package is the client for it (plus the server itself, as an extra). Already on Jev? Keep TypeSafe's SDK and change two environment variables.

You need API type What comes back
Does this need a refund? Noul Probability of yes
Which team should handle it? Choice One choice and probabilities for every option
How urgent is it? Score A position on your ordered scale
Which topics are mentioned? Multi Every selected option and its probability

1. Run your server

On a Linux machine with an NVIDIA GPU (24 GB is a practical start; see the hardware guide):

pip install "selfjev[serve,gpu]"
export SELFJEV_API_KEYS="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"   # your key, you choose it
selfjev serve --host 0.0.0.0 --port 8000

The first start downloads the selfjev-4b vision adapter (230 MB; text and images) and its Qwen3.5-4B base from Hugging Face. --adapter <dir or repo> serves your own fine-tune. Docker, AWS, Runpod and GCP recipes are in the deployment guide.

Extra For
selfjev the client only: httpx + pydantic, no torch
selfjev[serve] the model server (add gpu on Linux for the fast kernels)
selfjev[train] selfjev finetune and selfjev rlcd
selfjev[deploy] selfjev deploy aws

2a. Already using Jev? Change two variables

Code written for TypeSafe's typesafe-sdk runs unchanged against your server:

export TYPESAFE_BASE_URL="https://your-selfjev-host:8000"
export TYPESAFE_API_KEY="the key you set in SELFJEV_API_KEYS"
from typesafe_sdk import Choice, Noul, TypeSafeClient

client = TypeSafeClient()   # reads the two variables above
res = client.system_one(
    state="I was charged twice. Please refund the duplicate payment.",
    questions={
        "refund": Noul(instructions="Does the customer want a refund?"),
        "team": Choice(instructions="Which team?", criteria={"billing": "payments and refunds", "support": "technical issues"}),
    },
)

The default model name jev-latest is answered by selfjev-4b, and client.models.list(), errors and retries behave as they do against Jev. OpenRouter's decisions path (/api/alpha/decisions) is served too.

2b. Or use the selfjev client

pip install selfjev in your application. It adds Multi (select all that apply) and the fine-tuning API.

from selfjev import Choice, Multi, Noul, SelfJev

client = SelfJev(base_url="https://your-selfjev-host:8000", api_key="the key you set in SELFJEV_API_KEYS")

result = client.system_one(
    state="I was charged twice. Please refund the duplicate payment.",
    questions={
        "refund": Noul("Does the customer want a refund?"),
        "team": Choice("Which team should handle this?", {"billing": "payments and refunds", "support": "technical issues"}),
        "topics": Multi(
            "Which topics are mentioned?",
            {"payment": "a payment or charge", "refund": "a refund request", "login": "an account access problem"},
        ),
    },
)

print(result.nouls["refund"].noul)   # probability of yes
print(result.choices["team"].choice)  # selected team
print(result.multis["topics"].multi)  # selected topics

AsyncSelfJev has the same interface with await. SELFJEV_BASE_URL and SELFJEV_API_KEY work in place of the arguments.

Images (new in 0.3.0; Jev takes none): put a photo, a screenshot or a scanned document in state, alone or next to text. A Path, image bytes or a PIL image all work; on the wire it is a base64 data URL.

from pathlib import Path

result = client.system_one(
    state=[Path("cat.jpg")],
    questions={"breed": Choice("What breed is it?", {"persian": "a Persian cat", "siamese": "a Siamese cat"})},
)

The image is read once and every question is answered against it: 163 ms for one image and one question on an L40S, 136 ms for text. Fine-tuning takes image rows too.

Measured

SelfJev-4B Vision (the default since 0.3.0) served by TreeServer, compared with Jev on the same questions:

Suite Questions SelfJev-4B Vision Jev
Text decisions 1,991 96.1% 97.2%
AI response review 946 92.5% 92.5%
Broader text tasks (development benchmark) 3,471 84.1% 82.7%
Images (10 datasets, 4 never trained on) 2,002 90.4% no image input

These are project evaluations, not a universal ranking. See the results and limitations and the Decision Bench evaluation set.

The package code is Apache-2.0. The model weights carry their own licenses; see each model card.

Metadata

Release files for selfjev 0.3.0

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

Source distribution (sdist)

Source distribution for selfjev 0.3.0
File Size Uploaded
selfjev-0.3.0.tar.gz 71.5 kB Details

Built distribution (wheel)

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

Total release size: 157.6 kB

Release files / selfjev-0.3.0.tar.gz

Download URL selfjev-0.3.0.tar.gz
Size 71.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f85c6323ae7eb272f517a7924c3a62ef9133d6452d888f516197c02b7b650800
BLAKE2b-256 checksum
How to use checksums
b03cc7f641a9ac18317a27e30f6360cd17e4d96a933c836e080fb1235579f10d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / selfjev-0.3.0-py3-none-any.whl

Download URL selfjev-0.3.0-py3-none-any.whl
Size 86.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ffdd075376088e5d611cefd21c85f226ecf4d58f67da5eb2f65ad6ef261c156
BLAKE2b-256 checksum
How to use checksums
386248e776e7be51a2fb4c86154fc4021d06ae6cc24c673431fa3253ca463509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.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