SelfJev
SelfJev turns text 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 adapter (230 MB) 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.
Measured
SelfJev-4B served by TreeServer, compared with Jev on the same questions:
| Suite | Questions | SelfJev-4B | Jev |
|---|---|---|---|
| Text decisions | 1,991 | 95.7% | 97.2% |
| AI response review | 946 | 93.1% | 92.5% |
| Broader text tasks (development benchmark) | 3,471 | 83.8% | 82.7% |
These are project evaluations, not a universal ranking. See the results and limitations and the Decision Bench evaluation set.
Links
- API reference · Fine-tuning · Deployment
- Model: selfjev-4b · merged weights
- Source · Research notebook
The package code is Apache-2.0. The model weights carry their own licenses; see each model card.
Release files for selfjev 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| selfjev-0.2.0.tar.gz | 67.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| selfjev-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 149.4 kB
Release files / selfjev-0.2.0.tar.gz
| Download URL | selfjev-0.2.0.tar.gz |
|---|---|
| Size | 67.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ec05ff13797eac6d17cb3336c0d2e1e62b102e4ae0d0e5697cb217ba4821209
|
|
BLAKE2b-256 checksum How to use checksums |
98417b50f74fc8bdf980f3a0b237b8c799d3b5f4d5f11fd822062a42d43aed51
|
| 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 28, 2026.
Transparency logRelease files / selfjev-0.2.0-py3-none-any.whl
| Download URL | selfjev-0.2.0-py3-none-any.whl |
|---|---|
| Size | 81.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c81395c9872bd1af0708acdf6e66edc73cbe48a8af090edda876ee10cc4a02d
|
|
BLAKE2b-256 checksum How to use checksums |
289b67a01c2ade522ba1c7a41b4a39b4b59de7e97dcfcdd8bf67238532a400e7
|
| 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 28, 2026.
Transparency log