Jev · 9

Quyết định thì để Jev. Viết thì để LLM.Let Jev decide. Let the LLM write.

Jev là mô hình “System One” của TypeSafe AI: nhận trạng thái và câu hỏi có kiểu, trả về lựa chọn, điểm hoặc có/không kèm xác suất — không sinh văn bản. Chín chỗ dưới đây là nơi nó thay được một lệnh gọi LLM đắt và chậm.Jev is TypeSafe AI's “System One” model: it takes a state and typed questions and returns a choice, a score or a yes/no with probabilities — no generated text. The nine places below are where it can replace a slow, expensive LLM call.

Mô hình đưa ra con số. Ngưỡng là của bạn.The model gives a number. The threshold is yours.

Mỗi chấm là một quyết định mẫu, đặt theo độ tin cậy Jev trả về. Kéo hai ngưỡng để thấy đánh đổi: tự động nhiều hơn thì lỗi lọt vào nhánh tự làm nhiều hơn. Dữ liệu minh hoạ — ngưỡng thật phải đo trên dữ liệu của bạn.Each dot is a sample decision, placed by the confidence Jev returned. Drag the two thresholds to feel the trade-off: automate more and more errors slip into the act branch. Illustrative data — real thresholds must be measured on yours.

tự làm, act, sai wrong
xin xác nhậnconfirm
chuyển ngườihuman

quyết định đúngcorrect decisionquyết định saiwrong decision

Chọn cái nàoWhich one to pick

Bắt đầu từ câu hỏi quan trọng nhất: có cần gì trong chín thứ này không.Start with the most important question: do you need any of these nine at all.

Không dùng gì cả, khi…Use none of them when…

  • Đầu vào có cấu trúc và luật đã đúng: regex, SQL, enum.Input is structured and rules are already right: regex, SQL, enums.
  • Chỉ vài trăm quyết định mỗi ngày: LLM đang dùng tốn vài cent.Only a few hundred decisions a day: your current LLM costs cents.
  • Team chưa thống nhất được định nghĩa nhãn.The team can't agree on label definitions yet.
  • Đã có embedding hoặc vài nghìn nhãn ổn định: tự train classifier nhỏ và sở hữu nó.You have embeddings or a few thousand stable labels: train and own a small classifier.

Phương án rẻ nhất: luật trước, LLM hiện có cho phần còn lại. Jev đang early access — đặt nó sau interface của bạn.Cheapest option: rules first, your existing LLM for the rest. Jev is in early access — keep it behind your own interface.

  1. Quyết định có lặp đi lặp lại không?Does the decision repeat?

    Không → không cần Jev.No → you don't need Jev.

  2. Đáp án có thuộc một tập đóng: nhãn, điểm, có/không?Is the answer from a closed set: label, score, yes/no?

    Không → dùng LLM.No → use an LLM.

  3. Luật hoặc regex có đúng gần như tuyệt đối?Would rules or regex be almost always right?

    Có → dùng luật.Yes → use rules.

  4. Khối lượng hoặc độ trễ có là vấn đề đo được?Is volume or latency a measured problem?

    Không → LLM bạn đang có là đủ. Có → dùng Jev.No → your current LLM is enough. Yes → use Jev.

  5. Sai có đắt hoặc không đảo ngược được?Is a mistake expensive or irreversible?

    Có → thêm confidence gate, luật cứng, người duyệt. Không → lấy mẫu kiểm tra định kỳ.Yes → add a confidence gate, hard rules, human review. No → periodic sampled review.

Điều hướngRoute quyết định một thứ đi đâudecides where something goes

Model routing

Điều hướngRoute #1 trong ảnh#1 in image
route(prompt) → Choice<small | medium | large> promptJevsmall $medium $$large $$$

Đọc prompt, chọn model rẻ nhất đủ sức trả lời trước khi gọi.Read the prompt and pick the cheapest model that can handle it, before the call.

Dùng choUse for
Chatbot hỗ trợ, trợ lý code, pipeline tóm tắt dùng chung một endpoint.Support bots, coding assistants, summarisation pipelines sharing one endpoint.
ĐượcGain
Routing gần như miễn phí: 1 triệu prompt × 300 token ≈ 12,6 đô.Routing is nearly free: 1M prompts × 300 tokens ≈ $12.60.
MấtLose
Route nhầm xuống model nhỏ cho ra câu trả lời kém mà không ai báo lỗi.Misrouting down to a small model gives a weak answer nobody reports.

Đánh đổiTrade-off Đổi chất lượng ở những ca bị route nhầm lấy hoá đơn LLM giảm theo tỉ lệ prompt dễ.Trades quality on misrouted cases for an LLM bill that shrinks with your share of easy prompts.

Dấu hiệu nhận biếtHow to spot it Hoá đơn LLM cao trong khi phần lớn prompt là câu dễ.A high LLM bill while most prompts are easy.

Inbox triage

Điều hướngRoute #4 trong ảnh#4 in image
triage(email) → Choice<reply_now | later | archive> + Noul<urgent> emailJevreply_nowlaterarchive

Gắn hành động, team và mức khẩn cho từng thư trong một lệnh gọi.Tag each message with an action, a team and an urgency in one call.

Dùng choUse for
Hộp thư support, hộp thư founder, hàng đợi bình luận, ticket IT.Support inboxes, a founder's inbox, comment queues, IT tickets.
ĐượcGain
1.000 email × 7 quy tắc ≈ 9 cent, khoảng 6 giây khi chạy song song.1,000 emails × 7 rules ≈ 9 cents, about 6 seconds in parallel.
MấtLose
Archive nhầm một thư quan trọng là lỗi người dùng không bao giờ thấy.Archiving an important email by mistake is an error the user never sees.

Đánh đổiTrade-off Đổi việc tự mắt thấy từng thư lấy việc chỉ đọc những thư thật sự cần mình.Trades seeing every message yourself for reading only the ones that need you.

Dấu hiệu nhận biếtHow to spot it Có người mất hàng giờ mỗi ngày chỉ để kéo thư vào thư mục.Someone spends hours a day dragging mail into folders.

Bulk labeling

Điều hướngRoute #7 trong ảnh#7 in image
map(rows, q) → labels[N] · reduce = your SQL rows × NJevlabellabellabel

Chạy cùng một bộ câu hỏi trên hàng triệu dòng; Jev làm map, code của bạn làm reduce.Run the same questions over millions of rows; Jev maps, your code reduces.

Dùng choUse for
Review sản phẩm, chuẩn hoá catalog, nhãn yếu để train, lọc dữ liệu huấn luyện.Product reviews, catalogue cleanup, weak labels for training, training-data filtering.
ĐượcGain
1 triệu dòng × 400 token ≈ 17 đô; rẻ đến mức chạy lại cả bảng được.1M rows × 400 tokens ≈ $17; cheap enough to relabel the whole table.
MấtLose
Sai lệch hệ thống nhân theo quy mô: sai 5% là 50.000 dòng sai cùng một hướng.Systematic bias scales: 5% wrong is 50,000 rows wrong in the same direction.

Đánh đổiTrade-off Đổi độ chính xác từng dòng của người gán nhãn cẩn thận lấy việc phủ cả bảng trong vài giờ.Trades a careful annotator's per-row accuracy for covering the whole table in hours.

Dấu hiệu nhận biếtHow to spot it Câu hỏi bắt đầu bằng “bao nhiêu phần trăm trong toàn bộ…”.The question starts with “what percentage of all…”.

Hiệu đính so với ảnh:Correction to the image: Ảnh gọi là map-reduce; thực ra Jev chỉ làm bước map.The image says map-reduce; Jev only does the map step.

Cổng chặnGate quyết định một thứ có được đi tiếpdecides whether something may proceed

Guardrails

Cổng chặnGate #2 trong ảnh#2 in image
check(input) → Noul<injection>, Noul<abuse>, Noul<off_policy> inputJev→ LLMreviewblock

Kiểm đầu vào trước khi tới LLM: injection, lạm dụng, ngoài chính sách.Check input before it reaches the LLM: injection, abuse, off-policy content.

Dùng choUse for
Chatbot công khai, RAG đọc tài liệu người dùng tải lên, kiểm duyệt trước khi đăng.Public chatbots, RAG over user uploads, pre-publish moderation.
ĐượcGain
70–500 ms, đủ nhanh để lọc trước khi hiển thị; nhiều chính sách một lệnh gọi.70–500 ms, fast enough to filter before display; many policies per call.
MấtLose
Người tấn công kiên nhẫn sẽ vượt qua; chặn nhầm làm người dùng thật bỏ đi.Patient attackers get through; over-blocking drives real users away.

Đánh đổiTrade-off Đổi một tỉ lệ chặn nhầm người thật lấy việc chặn phần lớn lạm dụng trước khi nó tốn tiền LLM.Trades a rate of blocked real users for stopping most abuse before it costs LLM money.

Dấu hiệu nhận biếtHow to spot it Bạn gọi LLM chỉ để hỏi “input này có ổn không”.You call an LLM just to ask “is this input OK?”.

Hiệu đính so với ảnh:Correction to the image: Chỉ là một lớp phòng thủ; vẫn cần least privilege và kiểm đầu ra.One layer of defence only; still need least privilege and output checks.

Tool-call gating

Cổng chặnGate #3 trong ảnh#3 in image
gate(tool, args, goal) → Choice<allow | ask | deny> tool_callJevallowaskdeny

Đặt cổng giữa agent và tool: cho phép, hỏi lại hay từ chối trước khi thực thi.A gate between agent and tools: allow, ask or deny before execution.

Dùng choUse for
Coding agent chạy shell, agent email, agent database, agent thanh toán.Coding agents on a shell, email agents, database agents, payment agents.
ĐượcGain
Đủ rẻ để kiểm từng tool call; chỉ hỏi người khi thật sự mơ hồ.Cheap enough to check every call; ask a person only when it's truly ambiguous.
MấtLose
Cho phép nhầm một hành động không đảo ngược được là lỗi đắt nhất trong chín mục.Wrongly allowing an irreversible action is the costliest error of all nine.

Đánh đổiTrade-off Đổi sự chắc chắn của việc hỏi người ở mọi bước lấy agent chạy liền mạch mà vẫn dừng đúng chỗ.Trades asking a person at every step for an agent that flows yet still stops where it should.

Dấu hiệu nhận biếtHow to spot it Người dùng bấm “đồng ý” mà không đọc vì bị hỏi quá nhiều.Users click “yes” without reading because they're asked too often.

Confidence gate

Cổng chặnGate #9 trong ảnh#9 in image
c ≥ t_act → act · c < t_human → human · else confirm confidenceJevactconfirmhuman

Dùng độ tin cậy để chia ba nhánh; là lớp phủ lên cả tám mục còn lại.Use confidence to split into three paths; a layer over the other eight.

Dùng choUse for
Hoàn tiền tự động, gửi phần khó của bulk labeling cho người, route ticket.Automatic refunds, routing hard labels to people, ticket routing.
ĐượcGain
Tự động phần lớn ca với tỉ lệ lỗi thấp hơn nhiều; ngưỡng là một số trong config.Automates most cases at a far lower error rate; the threshold is a config number.
MấtLose
Ca tự tin cao mà sai vẫn xảy ra, và không ai xem chúng.High-confidence mistakes still happen, and nobody looks at them.

Đánh đổiTrade-off Đổi một phần tự động hoá lấy tỉ lệ lỗi chấp nhận được trên phần tự động.Trades some automation for an acceptable error rate on what you automate.

Dấu hiệu nhận biếtHow to spot it Muốn tự động hoá nhưng không chấp nhận lỗi của việc tự động 100%.You want automation but can't accept the errors of automating 100%.

Hiệu đính so với ảnh:Correction to the image: Ảnh ghi “classifier quyết định ngưỡng”. Sai: classifier đưa ra con số, bạn đặt ngưỡng. 0.9/0.5 chỉ là ví dụ.The image says “the classifier decides the thresholds”. Wrong: it gives the number, you set the threshold. 0.9/0.5 are examples.

Chấm điểmJudge đặt một thứ lên thang đoplaces something on a scale

Reranking

Chấm điểmJudge #5 trong ảnh#5 in image
fuse(retriever_score, Score(query, passage)) → top-k top-50Jev0.910.640.22

Chấm lại mức liên quan của tập ứng viên đã truy xuất, rồi gộp điểm.Re-score retrieved candidates for relevance, then fuse the scores.

Dùng choUse for
RAG trên wiki nội bộ, tìm sản phẩm theo tiêu chí mang nghĩa.RAG over an internal wiki, product search on meaningful criteria.
ĐượcGain
Thêm 0,06–0,09 NDCG@10 với khoảng 0,0002 đô mỗi truy vấn.Adds +0.06 to +0.09 NDCG@10 for about $0.0002 per query.
MấtLose
Không tăng recall; đứng một mình không thắng một embedding tốt.No recall gain; alone it doesn't beat a good embedding ranker.

Đánh đổiTrade-off Đổi thêm một lượt gọi và vài trăm ms lấy top-5 chính xác hơn cho LLM đọc.Trades one more call and a few hundred ms for a more accurate top-5.

Dấu hiệu nhận biếtHow to spot it Tài liệu đúng nằm trong top-50 nhưng hiếm khi lọt top-5.The right doc is in the top-50 but rarely in the top-5.

Hiệu đính so với ảnh:Correction to the image: Ảnh vẽ Jev xếp hạng thẳng docs. Đánh giá độc lập: chỉ có lợi khi làm tầng 2.The image has Jev ranking docs directly. Independent eval: it only helps as stage 2.

LLM evals

Chấm điểmJudge #6 trong ảnh#6 in image
judge(q, answer, src) → Score<1..5>, Noul<grounded> outputJevquality 4/5groundedon_topic

Làm giám khảo nhanh chấm đầu ra LLM theo thang điểm hoặc câu có/không.A fast judge grading LLM output on a scale or with yes/no questions.

Dùng choUse for
Regression test khi đổi prompt, giám sát production, best-of-N.Regression tests on prompt changes, production monitoring, best-of-N.
ĐượcGain
Đủ rẻ để chấm 100% lưu lượng thay vì lấy mẫu.Cheap enough to grade 100% of traffic instead of a sample.
MấtLose
Không giải thích vì sao điểm thấp; khó bắt lỗi logic nhiều bước.No reason for a low score; weak on multi-step logic errors.

Đánh đổiTrade-off Đổi độ sâu và lời giải thích của giám khảo LLM lớn lấy việc chấm mọi đầu ra, mọi lúc.Trades a large LLM judge's depth and explanations for grading every output, always.

Dấu hiệu nhận biếtHow to spot it Bạn bỏ qua eval vì LLM-as-judge quá tốn hoặc quá chậm.You skip evals because LLM-as-judge is too slow or costly.

Vòng lặpLoop quyết định lặp lại theo thời giandecides repeatedly over time

Real-time control

Vòng lặpLoop #8 trong ảnh#8 in image
loop { a = Choice(state); act(a) } tick ≥ p99 stateJevactiontick ≥ p99

Đọc trạng thái, chọn hành động, thực thi, lặp lại — ở tầng chiến thuật.Read state, choose an action, execute, repeat — at the tactical layer.

Dùng choUse for
Bot game nhịp chậm, bot giao dịch theo block, robot chọn chiến thuật, tự động hoá UI.Slow-paced game bots, per-block trading bots, robot tactics, UI automation.
ĐượcGain
Quyết định dưới một giây; Choice tới 255 hành động, luôn hợp lệ.Sub-second decisions; a Choice of up to 255 actions, always valid.
MấtLose
Không phải hard real-time; không đọc pixel; sai nhanh thì thiệt hại nhanh.Not hard real-time; no pixels; fast bad decisions do damage fast.

Đánh đổiTrade-off Đổi tính tất định và độ trễ cố định của code viết tay lấy quyết định linh hoạt mô tả bằng lời.Trades hand-written code's determinism and fixed latency for flexible decisions in plain language.

Dấu hiệu nhận biếtHow to spot it Vòng if/else đã quá rối nhưng LLM lại quá chậm.Your if/else loop is a mess but an LLM is too slow.

Hiệu đính so với ảnh:Correction to the image: Ảnh ghi mỗi 300 ms, nhưng độ trễ công bố là 70–500 ms. Đặt nhịp ≥ p99 đo thật.The image says every 300 ms, but reported latency is 70–500 ms. Set tick ≥ measured p99.

Bảng đánh đổiTrade-off table

Câu hỏi quyết định không phải cái nào tốt hơn, mà là sai thì mất gì và có kịp sửa không. Cái giá càng cao, càng khó đảo ngược, càng cần confidence gate và người duyệt.The deciding question isn't which is better, but what a mistake costs and whether you can undo it. The higher the cost and the harder to reverse, the more you need a confidence gate and human review.

Cái giá khi saiCost of a wrong callNhạy với độ trễLatency sensitivityĐảo ngược được?Reversible?
Model routingThấp–vừaLow–mediumVừaMediumCóYes
Inbox triageVừaMediumThấpLowCó, nếu archive = ẩnYes, if archive = hide
Bulk labelingThấp mỗi dòng, cao tổng thểLow per row, high in aggregateKhông quan trọngIrrelevantCó, chạy lại đượcYes, rerunnable
GuardrailsVừa khi chặn nhầm, cao khi lọtMedium over-blocking, high missingCaoHighMột phầnPartly
Tool-call gatingRất cao khi cho phép nhầmVery high when wrongly allowedCaoHighThường khôngUsually not
Confidence gateTuỳ hành động được gácDepends on the guarded action————
RerankingThấpLowCaoHighCóYes
LLM evalsThấp: chỉ là phép đoLow: only a measurementThấpLowCóYes
Real-time controlCao: tiền, phần cứngHigh: money, hardwareRất caoVery highKhôngNo

Anti-patterns

Sai lầmMistakeVì sao saiWhy it's wrongSửa thế nàoFix
Dùng Jev để tóm tắt hoặc viếtUsing Jev to summarise or writeJev không sinh văn bảnJev doesn't generate textGiao cho LLM; Jev chỉ lọc trướcGive it to an LLM; Jev filters first
Chép ngưỡng 0.9 / 0.5 từ ảnhCopying 0.9 / 0.5 from the imageChưa hiệu chỉnh trên dữ liệu của bạnNot calibrated on your dataĐo trên 300–1.000 ca có nhãn ngườiMeasure on 300–1,000 human-labelled cases
Coi xác suất lựa chọn thắng là độ tin cậyTreating top probability as confidenceHai số khác nhau: 0.84 so với 0.596 trong ví dụ của docsDifferent numbers: 0.84 vs 0.596 in the docsChọn một đại lượng, ghi rõ trong codePick one quantity, name it in code
“Không hallucinate” nghĩa là luôn đúng“Can't hallucinate” means always rightChỉ bảo đảm đáp án nằm trong schemaOnly guarantees answers stay in schemaVẫn đo độ chính xácStill measure accuracy
Dùng rerank thay retrievalRerank instead of retrievalKhông tăng recallDoesn't raise recallTầng 2 trên BM25/embedding, gộp điểmStage 2 over BM25/embedding, fuse scores
Guardrail là lớp bảo vệ duy nhấtGuardrail as the only protectionInjection là bài toán đối khángInjection is adversarialLeast privilege, kiểm đầu ra, luật cứngLeast privilege, output checks, hard rules
Nhịp vòng lặp nhỏ hơn p99Loop tick below p99Lỡ nhịp, hành vi thất thườngMissed beats, erratic behaviourNhịp ≥ p99, timeout, hành động dự phòngTick ≥ p99, timeout, fallback
Không ghim versionNot pinning the versionHành vi đổi âm thầm, ngưỡng trôiSilent behaviour change, threshold driftLog ID version, ghim sau khi chỉnh ngưỡngLog version ID, pin after tuning

Ba câu cần nhớThree things to remember