Unofficial field guide to TypeSafe AI's Jev

What people build with Jev, and how to build it

Jev is a model that answers typed questions about your data (pick one, rate it, yes or no) with probabilities instead of text, in milliseconds. Below: 98 real projects, rated by Jev itself, and guides with working code.

How Jev fits into an app

Read the full guide →
“I was charged twice!”

Customer

You ask Jev

  • Which queue?Choice
  • How frustrated?Score
  • Is it an outage?Noul
?:

Jev

Jev answers

  • Billing95% sure
  • 0.45 of 2
  • No2% chance

Billing team

your app routes it

not sure? a person decides

One request, no generated text. Illustrative numbers. Switch to Python, TypeScript or HTTP above to see the code.
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

client = TypeSafeClient()  # reads TYPESAFE_API_KEY

response = client.system_one(
    state={
        "subject": "Charged twice this month",
        "body": "Hi, I see two charges of $49 on my card for September. Can you refund one?",
    },
    questions={
        "queue": Choice(
            instructions="Which support team should handle the ticket in `subject` and `body`?",
            criteria={
                "billing": "Charges, invoices, refunds, payment methods",
                "technical": "Bugs, errors, outages, API problems",
                "other": "Anything that does not fit the teams above",
            },
        ),
        "frustration": Score(
            instructions="How frustrated is the customer in `body`?",
            criteria=["Calm", "Frustrated", "Very angry"],
        ),
        "is_outage_report": Noul(
            instructions="Does `body` report that the product is down right now?",
        ),
    },
)

queue = response.answers["queue"]        # .choice == "billing", .confidence == 0.90
if queue.confidence >= 0.8:              # your code decides, not the model
    route_to(queue.choice)               # your own function
else:
    send_to_a_person(response)           # your own function
import { choice, noul, score, TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient(); // reads TYPESAFE_API_KEY

const response = await client.systemOne({
  state: {
    subject: "Charged twice this month",
    body: "Hi, I see two charges of $49 on my card for September. Can you refund one?",
  },
  questions: {
    queue: choice("Which support team should handle the ticket in `subject` and `body`?", {
      billing: "Charges, invoices, refunds, payment methods",
      technical: "Bugs, errors, outages, API problems",
      other: "Anything that does not fit the teams above",
    }),
    frustration: score("How frustrated is the customer in `body`?", ["Calm", "Frustrated", "Very angry"]),
    is_outage_report: noul("Does `body` report that the product is down right now?"),
  },
});

const { queue } = response.answers; // queue.choice === "billing", queue.confidence === 0.9
if (queue.confidence >= 0.8) {
  routeTo(queue.choice); // your code decides, not the model
} else {
  sendToAPerson(response);
}
curl https://api.typesafe.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-latest",
    "state": {
      "subject": "Charged twice this month",
      "body": "Hi, I see two charges of $49 on my card for September. Can you refund one?"
    },
    "questions": {
      "queue": {
        "type": "choice",
        "instructions": "Which support team should handle the ticket in `subject` and `body`?",
        "criteria": {
          "billing": "Charges, invoices, refunds, payment methods",
          "technical": "Bugs, errors, outages, API problems",
          "other": "Anything that does not fit the teams above"
        }
      },
      "frustration": {
        "type": "score",
        "instructions": "How frustrated is the customer in `body`?",
        "criteria": ["Calm", "Frustrated", "Very angry"]
      },
      "is_outage_report": {
        "type": "noul",
        "instructions": "Does `body` report that the product is down right now?"
      }
    }
  }'

# -> { "answers": { "queue": { "choice": "billing", "confidence": 0.90, ... },
#                   "frustration": { "score": 0.45, ... },
#                   "is_outage_report": { "noul": 0.02 } } }

Use cases

See all 110 use casesSubmit yours

Learn the basics

Go to the source

This is an unofficial community site. API details change, so treat theofficial TypeSafe documentation as the source of truth, starting with theHTTP API reference and the list of known Jev limitations.

Read the official Jev docs