{"slug": "talk-to-jev", "title": "Talk to JEV", "summary": "TypeSafe AI's first System One model, Jev, is the subject of a new open-source demo called Grug that holds conversations by repeatedly selecting the next word from a compact 979-word vocabulary via the API's `choice` primitive. The demo connects to the real Jev API when a `TYPESAFE_API_KEY` is configured and otherwise falls back to a deterministic mock, running a grouped tournament of at most 249 options per sequential word and stopping after 18 words or when Jev selects the dedicated `end` control option. Grug requires Node.js 22.13 or newer, and TypeSafe notes the approach is a toy inversion of Jev's intended use rather than a recommended production chatbot architecture.", "body_md": "tiny vocabulary. big thought.\n\n[TypeSafe says Jev isn't an LLM](https://docs.typesafe.ai/concepts/system-one). Let's talk to it anyway. Grug is a tiny cave-chat experiment that makes Jev hold a conversation by repeatedly choosing its next word from a compact vocabulary. What could grug wrong?\n\nThe demo now connects to the real Jev API when `TYPESAFE_API_KEY` is configured. Without a key it falls back to a deterministic mock, so contributors can still run the interface immediately.\n\nJev is TypeSafe AI's first *System One* model. Unlike a large language model, it does not generate arbitrary text. You provide a `state` plus one or more typed questions, and it returns structured answers that code can use directly.\n\nThis demo uses the [`choice`](https://docs.typesafe.ai/primitives/choice) primitive: one answer is selected from options defined in advance, accompanied by a probability distribution and confidence value. In the real API, all questions in one request are evaluated independently and in parallel. Grug intentionally runs a grouped tournament for every sequential word, so this is a toy inversion of Jev's intended use—not a recommended production chatbot architecture.\n\n```\nconversation + words so far\n            │\n            ▼\n  Jev Choice: \"next word?\"\n            │\n            ▼\n approved word │ end\n            │\n            └── repeat until end\n```\n\nThe real request shape this project mirrors is:\n\n```\n{\n  \"state\": {\n    \"conversation\": [{ \"role\": \"user\", \"text\": \"How do I ship faster?\" }],\n    \"words_so_far\": [\"make\", \"small\"]\n  },\n  \"model\": \"jev-latest\",\n  \"questions\": {\n    \"next_word\": {\n      \"type\": \"choice\",\n      \"instructions\": \"Choose the next word in Grug reply.\",\n      \"criteria\": {\n        \"thing\": null,\n        \"first\": null,\n        \"end\": \"The answer is complete.\"\n      }\n    }\n  }\n}\n```\n\nSee the official [introduction](https://docs.typesafe.ai/introduction), [quick start](https://docs.typesafe.ai/introduction/quickstart), [state guide](https://docs.typesafe.ai/concepts/state), and [HTTP API reference](https://docs.typesafe.ai/api) for the authoritative interface.\n\nRequirements: Node.js 22.13 or newer.\n\n```\nnpm install\ncp .env.example .env\n# Add your TYPESAFE_API_KEY to .env\nnpm run dev\n```\n\nOpen the local URL printed in the terminal. A production build is equally small:\n\n```\nnpm run build\n```\n\n- Keeps a compact 979-word vocabulary in [`lib/core-vocabulary.ts`](https://github.com/mkotlikov/jev-grug/blob/main/lib/core-vocabulary.ts) , with request builders in[`lib/jev.ts`](https://github.com/mkotlikov/jev-grug/blob/main/lib/jev.ts) .\n- Gives every eligible word a chance through parallel groups of at most 249 options, then asks Jev to choose among each group’s strongest finalists or `end` .\n- Carries the conversation and `words_so_far` forward as structured state.\n- Extracts candidate names, numbers, and terms from user messages, then batches one Jev Noul judgment per non-numeric candidate to decide which words join the conversation vocabulary.\n- Always admits numeric tokens and displays accepted and rejected conversation words in the inspector.\n- Stops when Jev chooses the dedicated `end` control option or after 18 words.\n- Withholds the three most recent words and words already used twice to prevent repetition loops.\n- Validates every returned choice and retries documented `429` and`529` failures.\n- Shows Jev's real probabilities and confidence in the inspector.\n- Offers an ABC mode where Jev selects one character at a time from lowercase `a-z` ,`0-9` , apostrophe, space,`?` , and`.` , plus the separate`end` end-of-transmission control.\n- Falls back to [`lib/mock-jev.ts`](https://github.com/mkotlikov/jev-grug/blob/main/lib/mock-jev.ts) only when no key is configured.\n- Exposes the same chat action through the experimental WebMCP browser interface when available.\n\nThe fallback is deterministic for the same prompt and conversation length, which makes the demo easy to inspect and test.\n\nCreate an API key in the [TypeSafe console](https://console.typesafe.ai/) and put it in `.env`:\n\n```\nTYPESAFE_API_KEY=your_key_here\n```\n\nDo **not** put the key in a `NEXT_PUBLIC_*` variable or call the authenticated API directly from browser code. The browser calls the project's server route; only that route talks to TypeSafe.\n\n```\napp/\n  layout.tsx       page metadata and fonts\n  page.tsx         chat UI, trace inspector, and interaction loop\n  globals.css      visual system and responsive layout\n  api/chat/route.ts server-only Jev request loop and mock fallback\nlib/\n  core-vocabulary.ts compact common-English vocabulary\n  jev.ts           vocabulary, shared types, and Choice request builder\n  mock-jev.ts      deterministic fallback decisions\ntypes/\n  webmcp.d.ts      small browser API type declaration\n```\n\nThe public documentation describes Jev as an early-access model for fast, structured decisions. The API accepts a string, object, or array as state; `jev-latest` is the documented model alias; a Choice answer includes `choice`, `probabilities`, and `confidence`; and Choice supports a defined set of options. Jev is a product of TypeSafe AI. This project is an independent demo and is not affiliated with or endorsed by TypeSafe AI.\n\nResearch checked against TypeSafe AI's public documentation on September 17, 2026.\n\nCreated by **Michael Kotlikov**.", "url": "https://wpnews.pro/news/talk-to-jev", "canonical_source": "https://github.com/mkotlikov/jev-grug", "published_at": "2026-09-17 23:33:47+00:00", "updated_at": "2026-09-17 23:55:51.683125+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "ai-agents", "developer-tools", "large-language-models"], "entities": ["TypeSafe AI", "Jev", "Grug", "TYPESAFE_API_KEY", "Node.js 22.13", "WebMCP"], "alternates": {"html": "https://wpnews.pro/news/talk-to-jev", "markdown": "https://wpnews.pro/news/talk-to-jev.md", "text": "https://wpnews.pro/news/talk-to-jev.txt", "jsonld": "https://wpnews.pro/news/talk-to-jev.jsonld"}}