akash-kamat/jev-llm

An LLM built without a language model — using TypeSafe Jev's non-generative AI for contextual response selection. Zero hallucination. Zero prompt injection.

JavaScript

0

28 commits

updated Sep 20, 2026

See the code

See what people are saying (2)

SourceMessageScoreDate

Typesafe's JEV model work as an LLM (r/SideProject)

A conversational AI that doesn't generate a single token — it selects from 400 pre-written responses using TypeSafe's Jev, a non-generative model that returns probabilistic judgments instead of text. **The technical approach:** Traditional LLMs generate responses token by token. I flipped this — I…

1

Sep 20, 2026

Typesafe's JEV model work as an LLM [P] (r/MachineLearning)

I built a conversational AI that doesn't generate a single token — it selects from 400 pre-written responses using TypeSafe's Jev, a non-generative model that returns probabilistic judgments instead of text. **The technical approach:** Traditional LLMs generate responses token by token. I flipped…

2

Sep 20, 2026

README

Jev LLM

An "LLM" built without a language model. Zero text generation. Zero hallucination. Every response was written by a human.

Try the live demo →

TypeSafe's Jev is a non-generative AI — it returns typed judgments, not text. This project turns those judgments into a full conversational agent: 400 human-authored responses, multi-dimensional scoring, and contextual selection that makes it feel generative.

You: what is the purpose of life?
Jev: That's one of the big questions. I think purpose isn't found — it's built,
     through the things you care about and the people you show up for.

     Source: jev | Score: 0.82 | Intent: explanation/why | 847ms

No token was generated. Jev read 10 candidate responses and picked the one that best fit — scoring it across 6 dimensions in parallel.


How it works

2 API calls. ~800ms. ~$0.0001 per message.

                          User message
                               │
                               ▼
              ┌────────────────────────────────┐
              │     CALL 1: CLASSIFY (400ms)   │
              │                                │
              │  19 questions, 1 Jev call:      │
              │  ├─ Intent    (Choice)          │
              │  ├─ Formality (Score 0-4)       │
              │  ├─ Emotion   (Score 0-4)       │
              │  ├─ Needs human? (Noul 0-1)     │
              │  └─ Subcategory per intent      │
              │     (speculative fan-out)       │
              └───────────────┬────────────────┘
                              │
                     Gate checks:
                     needs_human > 0.8 → escalate
                     confidence < 0.3  → fallback
                              │
                              ▼
              ┌────────────────────────────────┐
              │   FETCH CANDIDATES (0ms)       │
              │   Code looks up 10 responses   │
              │   by intent + subcategory      │
              └───────────────┬────────────────┘
                              │
                              ▼
              ┌────────────────────────────────┐
              │     CALL 2: SCORE (400ms)      │
              │                                │
              │  Per candidate, score on:       │
              │  ├─ Relevance      (Score)      │
              │  ├─ Tone match     (Score)      │
              │  ├─ Helpfulness    (Score)      │
              │  ├─ Answers question (Noul)     │
              │  ├─ Specificity    (Score)      │
              │  └─ Natural flow   (Score)      │
              │                                │
              │  Context-aware weighted sum     │
              │  → Pick highest-scoring one     │
              └───────────────┬────────────────┘
                              │
                              ▼
                         Response ✓

Speculative fan-out: Call 1 asks the subcategory question for every intent in parallel — code only reads the answer for the winning intent. This eliminates a round trip without adding cost.


What is Jev?

Jev (by TypeSafe) is a non-generative AI model. It has three primitives:

PrimitiveReturnsExample
ChoiceBest pick + confidence + distribution over all options"Which intent?" → greeting (87%)
ScorePosition on an ordered scale + distribution"How formal?" → 3.2 / 4.0
NoulSingle 0-1 probability"Needs human?" → 0.12

It cannot write a single word. But it can judge — and judgment is all you need for selection.


Jev vs LLM

Jev LLMTraditional LLM
HallucinationImpossible — every response is human-authoredInherent risk
Prompt injectionNo attack surface — no generative layerOngoing vulnerability
Cost per message~$0.0001~$0.01-0.10
Latency~800ms (2 API calls)1-5s (token streaming)
Brand safetyGuaranteed — only pre-approved textNeeds guardrails
InspectabilityFull decision chain: intent → subcategory → scores → winnerBlack box
Handles anythingNo — needs candidates for each domainYes
Factual depthLimited by response bankLimited by training data
Content generationCannot (by design)Core strength

Where Jev LLM wins: Conversations where trust, consistency, and cost matter more than novelty — customer support, onboarding, game NPCs, FAQ bots, brand-safe assistants.

Where it can't compete: Open-ended generation, factual Q&A, writing tasks. (An optional LLM fallback catches these — see below.)


Worked example

User sends: "I'm really frustrated, my order has been wrong three times now"

Call 1 — Classify (one API call, 19 parallel questions):

intent:              complaint        (91% confidence)
subcategory:         empathetic       (speculative fan-out, read after intent wins)
formality:           1.2 / 4.0       (casual)
emotional_intensity: 3.8 / 4.0       (very high)
needs_human:         0.34            (not yet — try first)

Fetch candidates — code pulls 10 responses from complaint/empathetic:

1. "I hear you — that's genuinely frustrating. Let me see what I can do."
2. "Three times is way too many. I'm sorry about that, let's sort this out."
3. "That sounds really frustrating. You shouldn't have to deal with that."
4. "I understand your frustration — repeated issues are unacceptable."
5. "I'm sorry this keeps happening. That's not the experience you should be having."
...

Call 2 — Score (one API call, 60 parallel questions):

RelevanceToneHelpfulAnswersSpecificityNaturalWeighted
#10.780.850.720.690.710.820.77
#20.880.820.800.750.850.790.82
#30.720.900.550.520.600.880.70

Because emotional_intensity is high, weight profile shifts: tone gets 30% weight instead of 20%.

Winner: Response #2 — "Three times is way too many. I'm sorry about that, let's sort this out."

Acknowledges the specific issue ("three times"), validates emotion, and offers to help. Jev picked it because it scored highest on specificity and tone — exactly what a frustrated user needs.


The insight

Selection works like wisdom, not knowledge.

A wise person doesn't compute novel answers — they draw from collected perspectives and pick the one that fits. Jev does the same thing: 400 human-written responses, contextually selected.

This is why philosophical questions work remarkably well — philosophy has always been about selecting the right framing, not generating new information.


Setup

git clone https://github.com/akash-kamat/jev-llm.git
cd jev-llm
npm install

Create .env:

TYPESAFE_API_KEY=your_key_here

Get your API key at typesafe.ai.

# Interactive chat
node index.js

# Type "debug" to see scoring breakdown
# Type "quit" to exit

# Run test suite
node test.js

Optional: add ANTHROPIC_API_KEY in .env for LLM fallback on low-confidence responses.


Architecture

generative-jev/
├── jev-llm.js           ← Engine: classify → shortlist → score → rank
├── response-bank.js     ← 400 responses across 14 intents, 38 subcategories
├── templates.js         ← Dynamic slot filling for template responses
├── llm-fallback.js      ← Optional confidence-gated LLM fallback
├── index.js             ← Interactive CLI with debug mode
└── test.js              ← 23 test cases

14 intents: greeting, farewell, gratitude, question, request, complaint, small talk, meta (capabilities/limits), opinion, explanation, followup, humor, confusion, fallback

3 weight profiles: default (balanced), complaint/high-emotion (tone-heavy), casual/humor (natural-flow-heavy)

2-stage selection: When a subcategory has >10 candidates, a cheap Noul shortlist narrows to 5 before deep scoring.


What's next

  • Factual answer templates with data-backed slot filling
  • Honest limitation routing ("I can't write that, but here's what I can do")
  • Adaptive fallback threshold tuning
  • Response bank expansion to 1000+ candidates
  • Multi-turn conversation state

License

ISC

Contributors

akash-kamat

28 commits

akash-kamat/jev-llm

An LLM built without a language model — using TypeSafe Jev's non-generative AI for contextual response selection. Zero hallucination. Zero prompt injection.

JavaScript

0

28 commits

updated Sep 20, 2026

See the code

See what people are saying (2)

SourceMessageScoreDate

Typesafe's JEV model work as an LLM (r/SideProject)

A conversational AI that doesn't generate a single token — it selects from 400 pre-written responses using TypeSafe's Jev, a non-generative model that returns probabilistic judgments instead of text. **The technical approach:** Traditional LLMs generate responses token by token. I flipped this — I…

1

Sep 20, 2026

Typesafe's JEV model work as an LLM [P] (r/MachineLearning)

I built a conversational AI that doesn't generate a single token — it selects from 400 pre-written responses using TypeSafe's Jev, a non-generative model that returns probabilistic judgments instead of text. **The technical approach:** Traditional LLMs generate responses token by token. I flipped…

2

Sep 20, 2026

README

Jev LLM

An "LLM" built without a language model. Zero text generation. Zero hallucination. Every response was written by a human.

Try the live demo →

TypeSafe's Jev is a non-generative AI — it returns typed judgments, not text. This project turns those judgments into a full conversational agent: 400 human-authored responses, multi-dimensional scoring, and contextual selection that makes it feel generative.

You: what is the purpose of life?
Jev: That's one of the big questions. I think purpose isn't found — it's built,
     through the things you care about and the people you show up for.

     Source: jev | Score: 0.82 | Intent: explanation/why | 847ms

No token was generated. Jev read 10 candidate responses and picked the one that best fit — scoring it across 6 dimensions in parallel.


How it works

2 API calls. ~800ms. ~$0.0001 per message.

                          User message
                               │
                               ▼
              ┌────────────────────────────────┐
              │     CALL 1: CLASSIFY (400ms)   │
              │                                │
              │  19 questions, 1 Jev call:      │
              │  ├─ Intent    (Choice)          │
              │  ├─ Formality (Score 0-4)       │
              │  ├─ Emotion   (Score 0-4)       │
              │  ├─ Needs human? (Noul 0-1)     │
              │  └─ Subcategory per intent      │
              │     (speculative fan-out)       │
              └───────────────┬────────────────┘
                              │
                     Gate checks:
                     needs_human > 0.8 → escalate
                     confidence < 0.3  → fallback
                              │
                              ▼
              ┌────────────────────────────────┐
              │   FETCH CANDIDATES (0ms)       │
              │   Code looks up 10 responses   │
              │   by intent + subcategory      │
              └───────────────┬────────────────┘
                              │
                              ▼
              ┌────────────────────────────────┐
              │     CALL 2: SCORE (400ms)      │
              │                                │
              │  Per candidate, score on:       │
              │  ├─ Relevance      (Score)      │
              │  ├─ Tone match     (Score)      │
              │  ├─ Helpfulness    (Score)      │
              │  ├─ Answers question (Noul)     │
              │  ├─ Specificity    (Score)      │
              │  └─ Natural flow   (Score)      │
              │                                │
              │  Context-aware weighted sum     │
              │  → Pick highest-scoring one     │
              └───────────────┬────────────────┘
                              │
                              ▼
                         Response ✓

Speculative fan-out: Call 1 asks the subcategory question for every intent in parallel — code only reads the answer for the winning intent. This eliminates a round trip without adding cost.


What is Jev?

Jev (by TypeSafe) is a non-generative AI model. It has three primitives:

PrimitiveReturnsExample
ChoiceBest pick + confidence + distribution over all options"Which intent?" → greeting (87%)
ScorePosition on an ordered scale + distribution"How formal?" → 3.2 / 4.0
NoulSingle 0-1 probability"Needs human?" → 0.12

It cannot write a single word. But it can judge — and judgment is all you need for selection.


Jev vs LLM

Jev LLMTraditional LLM
HallucinationImpossible — every response is human-authoredInherent risk
Prompt injectionNo attack surface — no generative layerOngoing vulnerability
Cost per message~$0.0001~$0.01-0.10
Latency~800ms (2 API calls)1-5s (token streaming)
Brand safetyGuaranteed — only pre-approved textNeeds guardrails
InspectabilityFull decision chain: intent → subcategory → scores → winnerBlack box
Handles anythingNo — needs candidates for each domainYes
Factual depthLimited by response bankLimited by training data
Content generationCannot (by design)Core strength

Where Jev LLM wins: Conversations where trust, consistency, and cost matter more than novelty — customer support, onboarding, game NPCs, FAQ bots, brand-safe assistants.

Where it can't compete: Open-ended generation, factual Q&A, writing tasks. (An optional LLM fallback catches these — see below.)


Worked example

User sends: "I'm really frustrated, my order has been wrong three times now"

Call 1 — Classify (one API call, 19 parallel questions):

intent:              complaint        (91% confidence)
subcategory:         empathetic       (speculative fan-out, read after intent wins)
formality:           1.2 / 4.0       (casual)
emotional_intensity: 3.8 / 4.0       (very high)
needs_human:         0.34            (not yet — try first)

Fetch candidates — code pulls 10 responses from complaint/empathetic:

1. "I hear you — that's genuinely frustrating. Let me see what I can do."
2. "Three times is way too many. I'm sorry about that, let's sort this out."
3. "That sounds really frustrating. You shouldn't have to deal with that."
4. "I understand your frustration — repeated issues are unacceptable."
5. "I'm sorry this keeps happening. That's not the experience you should be having."
...

Call 2 — Score (one API call, 60 parallel questions):

RelevanceToneHelpfulAnswersSpecificityNaturalWeighted
#10.780.850.720.690.710.820.77
#20.880.820.800.750.850.790.82
#30.720.900.550.520.600.880.70

Because emotional_intensity is high, weight profile shifts: tone gets 30% weight instead of 20%.

Winner: Response #2 — "Three times is way too many. I'm sorry about that, let's sort this out."

Acknowledges the specific issue ("three times"), validates emotion, and offers to help. Jev picked it because it scored highest on specificity and tone — exactly what a frustrated user needs.


The insight

Selection works like wisdom, not knowledge.

A wise person doesn't compute novel answers — they draw from collected perspectives and pick the one that fits. Jev does the same thing: 400 human-written responses, contextually selected.

This is why philosophical questions work remarkably well — philosophy has always been about selecting the right framing, not generating new information.


Setup

git clone https://github.com/akash-kamat/jev-llm.git
cd jev-llm
npm install

Create .env:

TYPESAFE_API_KEY=your_key_here

Get your API key at typesafe.ai.

# Interactive chat
node index.js

# Type "debug" to see scoring breakdown
# Type "quit" to exit

# Run test suite
node test.js

Optional: add ANTHROPIC_API_KEY in .env for LLM fallback on low-confidence responses.


Architecture

generative-jev/
├── jev-llm.js           ← Engine: classify → shortlist → score → rank
├── response-bank.js     ← 400 responses across 14 intents, 38 subcategories
├── templates.js         ← Dynamic slot filling for template responses
├── llm-fallback.js      ← Optional confidence-gated LLM fallback
├── index.js             ← Interactive CLI with debug mode
└── test.js              ← 23 test cases

14 intents: greeting, farewell, gratitude, question, request, complaint, small talk, meta (capabilities/limits), opinion, explanation, followup, humor, confusion, fallback

3 weight profiles: default (balanced), complaint/high-emotion (tone-heavy), casual/humor (natural-flow-heavy)

2-stage selection: When a subcategory has >10 candidates, a cheap Noul shortlist narrows to 5 before deep scoring.


What's next

  • Factual answer templates with data-backed slot filling
  • Honest limitation routing ("I can't write that, but here's what I can do")
  • Adaptive fallback threshold tuning
  • Response bank expansion to 1000+ candidates
  • Multi-turn conversation state

License

ISC

Contributors

akash-kamat

28 commits

Languages

JavaScript

100.0%