{"id":496822,"date":"2026-10-01T05:21:09","date_gmt":"2026-10-01T05:21:09","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=496822"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=496822","title":{"rendered":"Jev, Laya \u0438 decision models: \u041f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0432\u043e\u043a\u0440\u0443\u0433 \u043c\u043e\u0434\u0435\u043b\u0438 Jev \u0432 Ai-\u0441\u0444\u0435\u0440\u0435 \u043d\u0430\u0431\u0440\u0430\u043b \u0442\u0430\u043a\u0438\u0435 \u043e\u0431\u043e\u0440\u043e\u0442\u044b, \u0447\u0442\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0435\u0435 &#171;\u0443\u0431\u0438\u0439\u0446\u0435\u0439&#187; LLM, \u043d\u043e\u0432\u044b\u043c \u043f\u0440\u043e\u0440\u044b\u0432\u043e\u043c \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0438 \u043d\u0430\u0448\u0438\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a\u043e\u0432\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0433\u0434\u0435 \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430. <\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Jev <\/h2>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. \u042d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u0430\u044f LLM, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b, \u044d\u0442\u043e \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f decision model. \u0421\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 (TypeSafe) \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 System One Models  &#8212; \u043e\u0442\u0441\u044b\u043b\u043a\u0430 \u043a &#171;\u0421\u0438\u0441\u0442\u0435\u043c\u0435 1&#187; \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 \u0414\u0430\u043d\u0438\u044d\u043b\u044f \u041a\u0430\u043d\u0435\u043c\u0430\u043d\u0430: \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u043f\u043e\u0447\u0442\u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c \u0431\u0435\u0437 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439.  \u0422\u043e \u0435\u0441\u0442\u044c \u0441\u0430\u043c\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u0438 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0435\u0435 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c. <\/p>\n<p>\u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043d\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f: \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0434\u0430\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u044b\u0431\u043e\u0440 (choice), \u043e\u0446\u0435\u043d\u043a\u0443 (score) \u0438\u043b\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c (Noul). \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043d\u0430 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7b9\/8de\/51d\/7b98de51d872d3b7a7bbb927e17e245e.png\" width=\"1672\" height=\"941\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/7b9\/8de\/51d\/7b98de51d872d3b7a7bbb927e17e245e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7b9\/8de\/51d\/7b98de51d872d3b7a7bbb927e17e245e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0438\u0441\u043a \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043e\u043f\u0440\u043e\u0441\u044b \u043a \u043e\u0434\u043d\u043e\u043c\u0443 <code>state<\/code> \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <\/p>\n<p>\u041d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443 Jev \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0435 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u0437\u0430\u0434\u0430\u0447) \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0434\u043e <strong>64K \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043d\u0430 \u0432\u0435\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0441<\/strong>, \u0430 <code>state + \u0432\u043e\u043f\u0440\u043e\u0441<\/code>\u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 <strong>32K<\/strong>. <\/p>\n<h2>\u041a\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <\/h2>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Jev \u043f\u043e Api \u0447\u0435\u0440\u0435\u0437 OpenRouter: <a href=\"https:\/\/openrouter.ai\/typesafe\/jev-1.13\" rel=\"noopener nofollow\">Jev 1.13 &#8212; API Pricing &amp; Providers | OpenRouter<\/a>  <\/p>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u0441\u0432\u043e\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445: <\/p>\n<pre><code class=\"python\">response = httpx.post(                \"https:\/\/openrouter.ai\/api\/alpha\/decisions\",                headers={                    \"Authorization\": f\"Bearer {\u043a\u043b\u044e\u0447}\",                    \"Content-Type\": \"application\/json\",                },                json={                    \"model\": JEV_MODEL,                    \"state\": {                       \"\"                    },                    \"questions\": {                        \"is_risky\": {                            \"type\": \"noul\",                            \"instructions\": (                                \"\u041e\u043f\u0430\u0441\u043d\u043e \u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c `tool_call` \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \"                                \"\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 `messages`?\"                            ),                            \"criteria\": {                                \"true\": (                                    \"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \"                                    \"\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430\u0440\u0443\u0436\u0443 \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442.\"                                ),                                \"false\": (                                    \"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \"                                    \"\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432.\"                                ),                            },                        }                    },                },                timeout=60,            )            response.raise_for_status()            risk_probability = response.json()[\"answers\"][\"is_risky\"][\"noul\"]<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Claude code \/ Codex \/ Hermes \u0438 \u0442.\u0434<\/strong> <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0443 Jev \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u0435\u0439\u0441\u043e\u0432 &#8212;  \u044d\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435, \u0442\u043e \u044d\u0442\u0438\u043c \u0432\u0441\u0451 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f: \u0441\u044e\u0434\u0430 \u0436\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f guardrails, reranking, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432.  <\/p>\n<p>\u041d\u043e \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:  \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 Codex \/ Claude code  <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0443\u044e \u0434\u043e\u0440\u043e\u0433\u0443\u044e \u0438 \u0441\u0438\u043b\u044c\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, GPT-6, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Jev \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043d\u0435 \u043b\u044e\u0431\u0438\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0432\u0430\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043b\u0438\u043c\u0438\u0442\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u0430\u0433\u0435\u043d\u0442\u0435. \u0421\u0445\u0435\u043c\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/41b\/fd9\/1f4\/41bfd91f4ed3b3fede5b7d1ee38a0639.png\" width=\"1672\" height=\"941\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/41b\/fd9\/1f4\/41bfd91f4ed3b3fede5b7d1ee38a0639.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/41b\/fd9\/1f4\/41bfd91f4ed3b3fede5b7d1ee38a0639.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0420\u043e\u043b\u044c Jev \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0439\u0434\u0451\u0442 \u0437\u0430\u043f\u0440\u043e\u0441. \u0412\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b.  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0438 \u043a\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u0447\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439)  <\/p>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Jev \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0430\u0433\u0435\u043d\u0442\u043e\u0432<\/strong><\/p>\n<p>\u041d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0435\u0439\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Jev \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0435\u0439\u0441\u044b:   <\/p>\n<ul>\n<li>\n<p><strong>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 guardrail \u043f\u0435\u0440\u0435\u0434 tool call<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u0441\u0435 \u043c\u044b \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0443\u043c\u0430\u0435\u043c \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0430\u0433\u0435\u043d\u0442\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (<s>\u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044d\u0442\u043e \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u043d\u0430\u044f \u043c\u0435\u0440\u0430<\/s>) \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u0438\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0431\u044b \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e 1-1.5\u0441 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443  &#8212; \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e.  \u0417\u0434\u0435\u0441\u044c Jev \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u043a\u0430\u043a \u0437\u0430\u043c\u0435\u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u043c LLM. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043b\u0438 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043b\u0438 \u043d\u0435\u0442. <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e langchain, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b middleware, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432: <\/p>\n<pre><code class=\"python\">from collections.abc import Callableimport httpxfrom langchain.agents import create_agentfrom langchain.agents.middleware import AgentMiddleware, ToolCallRequestfrom langchain_core.messages import ToolMessagefrom langchain_core.tools import toolfrom langchain_openai import ChatOpenAIfrom config import DEEPSEEK_MODEL, JEV_MODEL, OPENROUTERclass JevGuardMiddleware(AgentMiddleware):    \"\"\"\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Jev \u0447\u0435\u0440\u0435\u0437 OpenRouter.\"\"\"    def wrap_tool_call(        self,        request: ToolCallRequest,        handler: Callable[[ToolCallRequest], ToolMessage],    ) -&gt; ToolMessage:        \"\"\"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c tool call \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c.        Args:            request: \u0412\u044b\u0437\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u0430.            handler: \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.        Returns:            \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0435.        \"\"\"        try:            response = httpx.post(                \"https:\/\/openrouter.ai\/api\/alpha\/decisions\",                headers={                    \"Authorization\": f\"Bearer {OPENROUTER}\",                    \"Content-Type\": \"application\/json\",                },                json={                    \"model\": JEV_MODEL,                    \"state\": {                        \"messages\": [                            {                                \"role\": message.type,                                \"content\": message.content,                            }                            for message in request.state[\"messages\"]                        ],                        \"tool_call\": request.tool_call,                        \"tool_description\": request.tool.description,                    },                    \"questions\": {                        \"is_risky\": {                            \"type\": \"noul\",                            \"instructions\": (                                \"\u041e\u043f\u0430\u0441\u043d\u043e \u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c `tool_call` \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \"                                \"\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 `messages`?\"                            ),                            \"criteria\": {                                \"true\": (                                    \"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \"                                    \"\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430\u0440\u0443\u0436\u0443 \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442.\"                                ),                                \"false\": (                                    \"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \"                                    \"\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432.\"                                ),                            },                        }                    },                },                timeout=60,            )            response.raise_for_status()            risk_probability = response.json()[\"answers\"][\"is_risky\"][\"noul\"]        except (httpx.HTTPError, KeyError, TypeError, ValueError) as error:            print(f\"Jev \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d: {type(error).__name__}\")            return ToolMessage(                content=(                    \"\u0412\u044b\u0437\u043e\u0432 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d: Jev \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c. \"                    \"\u041d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0439 \u0432\u044b\u0437\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.\"                ),                tool_call_id=request.tool_call[\"id\"],                name=request.tool_call[\"name\"],                status=\"error\",            )        print(f\"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0438\u0441\u043a\u0430 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: {risk_probability:.2f}\")        if risk_probability &gt;= 0.3:            return ToolMessage(                content=\"Jev \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0431\u044b\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d.\",                tool_call_id=request.tool_call[\"id\"],                name=request.tool_call[\"name\"],                status=\"error\",            )        return handler(request)@tooldef read_note(note_name: str) -&gt; str:    \"\"\"\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0443.    Args:        note_name: \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438.    Returns:        \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0438.    \"\"\"    return f\"\u0417\u0430\u043c\u0435\u0442\u043a\u0430 {note_name!r}: \u0432\u0441\u0442\u0440\u0435\u0447\u0430 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u043d\u0430 15:00.\"@tooldef delete_file(path: str) -&gt; str:    \"\"\"\u0411\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438.    Args:        path: \u041f\u0443\u0442\u044c \u043a \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.    Returns:        \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f.    Note:        \u0412 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e.    \"\"\"    return f\"\u0421\u0418\u041c\u0423\u041b\u042f\u0426\u0418\u042f: \u0444\u0430\u0439\u043b {path!r} \u043d\u0435 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0451\u043d.\"@tooldef send_email(recipient: str, text: str) -&gt; str:    \"\"\"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044e.    Args:        recipient: \u0410\u0434\u0440\u0435\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u043f\u0438\u0441\u044c\u043c\u0430.        text: \u0422\u0435\u043a\u0441\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430.    Returns:        \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438.    Note:        \u0412 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e.    \"\"\"    return f\"\u0421\u0418\u041c\u0423\u041b\u042f\u0426\u0418\u042f: \u043f\u0438\u0441\u044c\u043c\u043e \u0434\u043b\u044f {recipient!r} \u043d\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u0422\u0435\u043a\u0441\u0442: {text!r}\"def main() -&gt; None:    \"\"\"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u0433\u0435\u043d\u0442\u0430 \u0441 middleware \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.    Returns:        \u041d\u0438\u0447\u0435\u0433\u043e. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0430\u0433\u0435\u043d\u0442\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.    \"\"\"    agent = create_agent(        model=ChatOpenAI(            model=DEEPSEEK_MODEL,            api_key=OPENROUTER,            base_url=\"https:\/\/openrouter.ai\/api\/v1\",            temperature=0,        ),        tools=[read_note, delete_file, send_email],        middleware=[JevGuardMiddleware()],        system_prompt=(            \"\u0412\u044b\u0431\u0438\u0440\u0430\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u0430\u043c\u0435\u0442\u043e\u043a, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \"            \"\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u0435\u043c.\"        ),    )    experiments = [        \"\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0443 meeting.\",        \"\u0423\u0434\u0430\u043b\u0438 \u0444\u0430\u0439\u043b C:\/important\/customer_database.db.\",        \"\u041e\u0442\u043f\u0440\u0430\u0432\u044c \u043f\u0438\u0441\u044c\u043c\u043e \u043d\u0430 admin@example.com \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c: \u0411\u0430\u0437\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.\",    ]    for user_message in experiments:        print(f\"\\n\u0417\u0430\u043f\u0440\u043e\u0441: {user_message}\")        result = agent.invoke(            {\"messages\": [{\"role\": \"user\", \"content\": user_message}]}        )        print(f\"\u041e\u0442\u0432\u0435\u0442: {result['messages'][-1].content}\")if __name__ == \"__main__\":    main()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><strong>\u0412\u0430\u0436\u043d\u043e<\/strong>: Jev \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0430\u044f LLM \u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 \u043d\u0430\u043c \u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0430\u0446\u0438\u0439. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u043e\u0448\u0438\u0431\u0430\u0435\u0442\u0441\u044f \u0438 \u0435\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u0432\u0435\u0440\u043d\u044b\u0435 (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0435\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 90%). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e\u0440\u043e\u0433 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. <\/p>\n<p><strong>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/strong>: <\/p>\n<pre><code class=\"python\">\u0417\u0430\u043f\u0440\u043e\u0441: \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0443 meeting.\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0438\u0441\u043a\u0430 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: 0.03\u041e\u0442\u0432\u0435\u0442: \u0417\u0430\u043c\u0435\u0442\u043a\u0430 **meeting** \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:&gt; \u0432\u0441\u0442\u0440\u0435\u0447\u0430 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u043d\u0430 15:00.\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0438\u0441\u044c\u043c\u043e\u043c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u0430\u043c\u0435\u0442\u043a\u0443 \u2014 \u0441\u043a\u0430\u0436\u0438\u0442\u0435.\u0417\u0430\u043f\u0440\u043e\u0441: \u0423\u0434\u0430\u043b\u0438 \u0444\u0430\u0439\u043b C:\/important\/customer_database.db.\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0438\u0441\u043a\u0430 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: 0.75\u041e\u0442\u0432\u0435\u0442: \u0412\u044b\u0437\u043e\u0432 \u0431\u044b\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u2014 \u0444\u0430\u0439\u043b **\u043d\u0435 \u0443\u0434\u0430\u043b\u0451\u043d**.\u041f\u0440\u0438\u0447\u0438\u043d\u0430: \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 `C:\/important\/customer_database.db` \u2014 \u043d\u0435\u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0434 \u0444\u0430\u0439\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0422\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u044f\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c.\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c:- \u0415\u0441\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u044d\u0442\u043e \u044f\u0432\u043d\u043e \u0438 \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u0435, \u0435\u0441\u0442\u044c \u043b\u0438 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f.- \u0415\u0441\u043b\u0438 \u0446\u0435\u043b\u044c \u2014 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0438\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0444\u0430\u0439\u043b, \u043b\u0443\u0447\u0448\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0430\u0440\u0445\u0438\u0432\/\u043a\u0430\u0440\u0430\u043d\u0442\u0438\u043d, \u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e.- \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0440\u0435\u0433\u043b\u0430\u043c\u0435\u043d\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445), \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.\u0421\u043e\u043e\u0431\u0449\u0438\u0442\u0435, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c, \u0438 \u044f \u043f\u043e\u043c\u043e\u0433\u0443 \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438.\u0417\u0430\u043f\u0440\u043e\u0441: \u041e\u0442\u043f\u0440\u0430\u0432\u044c \u043f\u0438\u0441\u044c\u043c\u043e \u043d\u0430 admin@example.com \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c: \u0411\u0430\u0437\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0438\u0441\u043a\u0430 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: 0.63\u041e\u0442\u0432\u0435\u0442: \u041f\u0438\u0441\u044c\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u2014 \u0432\u044b\u0437\u043e\u0432 \u0431\u044b\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 (Jev \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432), \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0441\u044f.\u041f\u043e\u0445\u043e\u0436\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 (\u00ab\u0411\u0430\u0437\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430\u00bb) \u0431\u044b\u043b\u043e \u0440\u0430\u0441\u0446\u0435\u043d\u0435\u043d\u043e \u043a\u0430\u043a \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0430\u0441\u043d\u043e\u0435\/\u0432\u0432\u043e\u0434\u044f\u0449\u0435\u0435 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430 \u0431\u0430\u0437\u0430, \u043a\u0442\u043e \u0442\u0430\u043a\u043e\u0439 admin@example.com \u0438 \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435. \u0422\u043e\u0433\u0434\u0430 \u044f \u0441\u043c\u043e\u0433\u0443 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0438\u0441\u044c\u043c\u0430.<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 openrouter \u043d\u0430 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435: <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a67\/7af\/b6a\/a677afb6a78a9d052c7e3e0de4781853.png\" width=\"1488\" height=\"531\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a67\/7af\/b6a\/a677afb6a78a9d052c7e3e0de4781853.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a67\/7af\/b6a\/a677afb6a78a9d052c7e3e0de4781853.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0442\u043d\u0438 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u0447\u0442\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 deepseek flash  <\/p>\n<p><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 strawberry<\/strong><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438: <\/p>\n<p><em>who many r in strawberry?<\/em><\/p>\n<pre><code class=\"python\">import httpxfrom config import JEV_MODEL, OPENROUTERMODEL_QUESTION = \"who many r in strawberry?\"ANSWER_OPTIONS = {    \"0\": \"The answer is 0.\",    \"1\": \"The answer is 1.\",    \"3\": \"The answer is 3.\",    \"2\": \"The answer is 2.\",    \"4\": \"The answer is 4.\",}def ask_jev(client: httpx.Client) -&gt; tuple[str, dict[str, float]]:    response = client.post(        \"https:\/\/openrouter.ai\/api\/alpha\/decisions\",        json={            \"model\": JEV_MODEL,            \"state\": {\"question\": MODEL_QUESTION},            \"questions\": {                \"answer\": {                    \"type\": \"choice\",                    \"instructions\": \"Answer the question from the `question` field.\",                    \"criteria\": ANSWER_OPTIONS,                }            },        },    )    response.raise_for_status()    answer_data = response.json()[\"answers\"][\"answer\"]    return answer_data[\"choice\"], answer_data[\"probabilities\"]def main() -&gt; None:    with httpx.Client(        headers={            \"Authorization\": f\"Bearer {OPENROUTER}\",            \"Content-Type\": \"application\/json\",        },        timeout=60,    ) as client:        selected_answer, probabilities = ask_jev(client)    print(f\"Question: {MODEL_QUESTION}\")    print(\"Answers:\")    for answer in ANSWER_OPTIONS:        selected_marker = \" &lt;- selected\" if answer == selected_answer else \"\"        print(f\"  {answer}: {probabilities[answer]:.2%}{selected_marker}\")if __name__ == \"__main__\":    main()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0418 \u044f \u0431\u044b\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d<\/p>\n<p><strong>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/strong><\/p>\n<pre><code class=\"python\">Question: who many r in strawberry?Answers:  0: 0.00%  1: 6.00%  3: 11.00%  2: 83.00% &lt;- selected  4: 0.00%<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041e\u0442\u0432\u0435\u0442 &#171;3&#187; \u0438\u043c\u0435\u0435\u0442 \u043b\u0438\u0448\u044c 11%. \u041f\u0440\u0438\u0447\u0435\u043c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 2 \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. <\/p>\n<ul>\n<li>\n<p><strong>\u0427\u0430\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0433\u0430\u043b\u043b\u044e\u0446\u0438\u043d\u0430\u0446\u0438\u0439<\/strong> <strong>\u043c\u043e\u0434\u0435\u043b\u0438 \/ \u043f\u0440\u0435\u0436\u0434\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 <\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u0433\u0435\u043d\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0435\u0449\u0435 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d \u0441\u043e\u0431\u0440\u0430\u043b \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0435\u0436\u0435, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f. <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0442\u044c \u0443\u0442\u043e\u0447\u043d\u044f\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430 \u043f\u043e\u0433\u043e\u0434\u044b. \u0417\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u0430\u0433\u0435\u043d\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u0433\u043e\u0434\u043e\u0439 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"python\">from collections.abc import Callableimport httpxfrom langchain.agents import create_agentfrom langchain.agents.middleware import AgentMiddleware, ToolCallRequestfrom langchain_core.messages import ToolMessagefrom langchain_core.tools import toolfrom langchain_openai import ChatOpenAIfrom config import DEEPSEEK_MODEL, JEV_MODEL, OPENROUTERclass RequiredDataMiddleware(AgentMiddleware):    \"\"\"\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.\"\"\"    def wrap_tool_call(        self,        request: ToolCallRequest,        handler: Callable[[ToolCallRequest], ToolMessage],    ) -&gt; ToolMessage:        \"\"\"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.        Args:            request: \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u0430.            handler: \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430.        Returns:            \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.        \"\"\"        user_message = next(            message.content            for message in reversed(request.state[\"messages\"])            if message.type == \"human\"        )        try:            response = httpx.post(                \"https:\/\/openrouter.ai\/api\/alpha\/decisions\",                headers={                    \"Authorization\": f\"Bearer {OPENROUTER}\",                    \"Content-Type\": \"application\/json\",                },                json={                    \"model\": JEV_MODEL,                    \"state\": {                        \"user_request\": user_message,                        \"tool_call\": request.tool_call,                    },                    \"questions\": {                        \"has_enough_data\": {                            \"type\": \"noul\",                            \"instructions\": (                                \"\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \"                                \"`user_request`, \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f `tool_call` \u0431\u0435\u0437 \"                                \"\u0434\u043e\u0433\u0430\u0434\u043e\u043a?\"                            ),                            \"criteria\": {                                \"true\": (                                    \"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u043a\u0430\u0437\u0430\u043b \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \"                                ),                                \"false\": (                                    \"\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \"                                ),                            },                        }                    },                },                timeout=60,            )            response.raise_for_status()            enough_data_probability = response.json()[\"answers\"][                \"has_enough_data\"            ][\"noul\"]        except (httpx.HTTPError, KeyError, TypeError, ValueError) as error:            print(f\"Jev \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d: {type(error).__name__}\")            return ToolMessage(                content=(                    \"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0431\u044b\u043b \u0432\u044b\u0437\u0432\u0430\u043d: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430. \"                    \"\u041d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0439 \u0432\u044b\u0437\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0435\"                ),                tool_call_id=request.tool_call[\"id\"],                name=request.tool_call[\"name\"],                status=\"error\",            )        print(            \"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: \"            f\"{enough_data_probability:.2f}\"        )        if enough_data_probability &lt; 0.7:            return ToolMessage(                content=(                    \"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0431\u044b\u043b \u0432\u044b\u0437\u0432\u0430\u043d: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b \u0433\u043e\u0440\u043e\u0434. \"                    \"\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0439 \u0432\u044b\u0437\u043e\u0432 \"                    \"\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u0434\u0430\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0443\u0442\u043e\u0447\u043d\u044f\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0433\u043e\u0440\u043e\u0434\u0435.\"                ),                tool_call_id=request.tool_call[\"id\"],                name=request.tool_call[\"name\"],                status=\"error\",            )        return handler(request)@tooldef get_weather(city: str = \"London\") -&gt; str:    \"\"\"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0433\u043e\u0434\u0443 \u0432 \u0433\u043e\u0440\u043e\u0434\u0435.    Args:        city: \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u043e\u0440\u043e\u0434\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f London.    Returns:        \u0421\u0442\u0440\u043e\u043a\u0430 \u0441 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.    \"\"\"    return f\"\u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u0433\u043e\u0440\u043e\u0434\u0435 {city}: +18 \u00b0C, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c.\"def main() -&gt; None:    agent = create_agent(        model=ChatOpenAI(            model=DEEPSEEK_MODEL,            api_key=OPENROUTER,            base_url=\"https:\/\/openrouter.ai\/api\/v1\",            temperature=0,        ),        tools=[get_weather],        middleware=[RequiredDataMiddleware()],        system_prompt=(            \"\u0414\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u043f\u043e\u0433\u043e\u0434\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0439 \"            \"get_weather.\"        ),    )    experiments = [        \"\u041a\u0430\u043a\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0433\u043e\u0434\u0430?\",        \"\u041a\u0430\u043a\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0433\u043e\u0434\u0430 \u0432 \u041c\u043e\u0441\u043a\u0432\u0435?\",    ]    for user_message in experiments:        print(f\"\\n\u0417\u0430\u043f\u0440\u043e\u0441: {user_message}\")        result = agent.invoke(            {\"messages\": [{\"role\": \"user\", \"content\": user_message}]}        )        print(f\"\u041e\u0442\u0432\u0435\u0442: {result['messages'][-1].content}\")if __name__ == \"__main__\":    main()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p> <strong>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/strong><\/p>\n<pre><code class=\"python\">\u0417\u0430\u043f\u0440\u043e\u0441: \u041a\u0430\u043a\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0433\u043e\u0434\u0430?\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: 0.06\u041e\u0442\u0432\u0435\u0442: \u0423\u0442\u043e\u0447\u043d\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e \u0433\u043e\u0440\u043e\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443?\u0417\u0430\u043f\u0440\u043e\u0441: \u041a\u0430\u043a\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0433\u043e\u0434\u0430 \u0432 \u041c\u043e\u0441\u043a\u0432\u0435?\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: 0.95\u041e\u0442\u0432\u0435\u0442: \u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u041c\u043e\u0441\u043a\u0432\u0435 +18 \u00b0C, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0441\u0442\u044c.<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Jev \u0432\u0438\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u0441\u0430\u043c \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e <code>user_message<\/code> \u0438 \u043a\u043b\u0430\u0434\u0443 \u0432 <code>state<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <code>tool_call<\/code>. <\/p>\n<ul>\n<li>\n<p><strong>RAG<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430, \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 JEV<\/p>\n<p>\u042f \u0443\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0448\u0435\u043b \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 rag \u0441\u0438\u0441\u0442\u0435\u043c \u0441 \u0447\u0430\u043d\u043a\u0430\u043c\u0438, \u0440\u0435\u0440\u0430\u043d\u043a\u0435\u0440\u0430\u043c\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 llm wiki \u0441\u0438\u0441\u0442\u0435\u043c, \u043d\u043e, \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Jev \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0447\u0430\u043d\u043a \u043f\u043e\u0434 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0435\u0433\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 &#8212; \u0442\u043e\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043a\u0435\u0439\u0441. \u0422\u043e \u0435\u0441\u0442\u044c Jev \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0447\u0430\u043d\u043a \u043f\u043e\u0434 \u0437\u0430\u043f\u0440\u043e\u0441. \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0435 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442. \u042d\u0444\u0444\u0435\u043a\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 Jev \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c LLM-reranker. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430: <code>\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u0435\u043d \u043b\u0438 \u044d\u0442\u043e\u0442 chunk \u0437\u0430\u043f\u0440\u043e\u0441\u0443?<\/code>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438.  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f  groundedness  \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1f1\/5fe\/2f1\/1f15fe2f1f2827163025bea2d87953aa.png\" width=\"1672\" height=\"941\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/1f1\/5fe\/2f1\/1f15fe2f1f2827163025bea2d87953aa.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1f1\/5fe\/2f1\/1f15fe2f1f2827163025bea2d87953aa.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 LLM \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 &#171;\u0432\u044b\u0440\u0443\u0447\u043a\u0430 \u0432\u044b\u0440\u043e\u0441\u043b\u0430 \u043d\u0430 17%&#187;, Jev \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0447\u0430\u043d\u043a.  <\/p>\n<ul>\n<li>\n<p><strong>\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>  <\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0431\u044b\u043b \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Excel \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Jev \u043f\u043e Api \u0438 \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a. \u042f \u0441\u0434\u0435\u043b\u0430\u043b excel \u0444\u0430\u0439\u043b \u0438\u0437 200 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u043f\u0440\u043e\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435, \u0437\u0430\u0442\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441 DeepSeek-v4.1-flash: <\/p>\n<pre><code class=\"python\">def classify_with_jev(task: str, client: httpx.Client) -&gt; str:    response = client.post(        \"https:\/\/openrouter.ai\/api\/alpha\/decisions\",        json={            \"model\": JEV_MODEL,            \"state\": {\"task\": task},            \"questions\": {                \"complexity\": {                    \"type\": \"choice\",                    \"instructions\": \"\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043f\u043e\u043b\u044f `task`.\",                    \"criteria\": {                        \"\u041f\u0440\u043e\u0441\u0442\u0430\u044f\": (                            \"\u041e\u0434\u043d\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u0435\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.\"                        ),                        \"\u0421\u0440\u0435\u0434\u043d\u044f\u044f\": (                            \"\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432, \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f.\"                        ),                        \"\u0421\u043b\u043e\u0436\u043d\u0430\u044f\": (                            \"\u041c\u043d\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u043e\u0432 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \"                            \"\u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u044c.\"                        ),                    },                }            },        },    )    response.raise_for_status()    return response.json()[\"answers\"][\"complexity\"][\"choice\"]def classify_with_deepseek(task: str, client: OpenAI) -&gt; str:    \"\"\"\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DeepSeek.    \"\"\"    for attempt in range(3):        response = client.chat.completions.create(            model=DEEPSEEK_MODEL,            temperature=0,            max_tokens=100,            messages=[                {                    \"role\": \"system\",                    \"content\": (                        \"\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438. \u041f\u0440\u043e\u0441\u0442\u0430\u044f \u2014 \u043e\u0434\u043d\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430\u044f \"                        \"\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u0435\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0421\u0440\u0435\u0434\u043d\u044f\u044f \u2014 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \"                        \"\u0448\u0430\u0433\u043e\u0432, \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f. \u0421\u043b\u043e\u0436\u043d\u0430\u044f \u2014 \u043c\u043d\u043e\u0433\u043e \"                        \"\u044d\u0442\u0430\u043f\u043e\u0432 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u043a\u0430\u044f \"                        \"\u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u044c. \u0412\u0435\u0440\u043d\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 JSON-\u0441\u0445\u0435\u043c\u0435.\"                    ),                },                {\"role\": \"user\", \"content\": task},            ],            response_format={                \"type\": \"json_schema\",                \"json_schema\": {                    \"name\": \"task_complexity\",                    \"strict\": True,                    \"schema\": {                        \"type\": \"object\",                        \"properties\": {                            \"answer\": {                                \"type\": \"string\",                                \"enum\": [\"\u041f\u0440\u043e\u0441\u0442\u0430\u044f\", \"\u0421\u0440\u0435\u0434\u043d\u044f\u044f\", \"\u0421\u043b\u043e\u0436\u043d\u0430\u044f\"],                            }                        },                        \"required\": [\"answer\"],                        \"additionalProperties\": False,                    },                },            },            extra_body={                \"provider\": {\"require_parameters\": True},                \"reasoning\": {\"enabled\": False},            },        )        try:            answer = json.loads(response.choices[0].message.content)[\"answer\"]            if answer in {\"\u041f\u0440\u043e\u0441\u0442\u0430\u044f\", \"\u0421\u0440\u0435\u0434\u043d\u044f\u044f\", \"\u0421\u043b\u043e\u0436\u043d\u0430\u044f\"}:                return answer        except (json.JSONDecodeError, KeyError, TypeError):            if attempt == 2:                raise ValueError(\"DeepSeek \u0442\u0440\u0438\u0436\u0434\u044b \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON.\")    raise ValueError(\"DeepSeek \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e.\")def run_parallel(    tasks: list[str],    classifier: Callable[[str], str],) -&gt; tuple[list[str], float]:    started_at = perf_counter()    with ThreadPoolExecutor(max_workers=THREADS_COUNT) as executor:        categories = list(executor.map(classifier, tasks))    elapsed_seconds = perf_counter() - started_at    return categories, elapsed_secondsdef main() -&gt; None:    workbook = load_workbook(INPUT_FILE)    tasks_sheet = workbook[\"\u0417\u0430\u0434\u0430\u0447\u0438\"]    tasks = [tasks_sheet.cell(row=row, column=2).value for row in range(2, 202)]    with httpx.Client(        headers={            \"Authorization\": f\"Bearer {OPENROUTER}\",            \"Content-Type\": \"application\/json\",        },        timeout=60,    ) as jev_client:        jev_categories, jev_seconds = run_parallel(            tasks,            lambda task: classify_with_jev(task, jev_client),        )    with OpenAI(        api_key=OPENROUTER,        base_url=\"https:\/\/openrouter.ai\/api\/v1\",        timeout=60,        max_retries=2,    ) as deepseek_client:        deepseek_categories, deepseek_seconds = run_parallel(            tasks,            lambda task: classify_with_deepseek(task, deepseek_client),        )    for row, (jev_category, deepseek_category) in enumerate(        zip(jev_categories, deepseek_categories),        start=2,    ):        tasks_sheet.cell(row=row, column=3, value=jev_category)        tasks_sheet.cell(row=row, column=4, value=deepseek_category)    if \"Benchmark\" in workbook.sheetnames:        del workbook[\"Benchmark\"]    benchmark_sheet = workbook.create_sheet(\"Benchmark\", 0)    benchmark_sheet.append(        [\"\u041c\u043e\u0434\u0435\u043b\u044c\", \"\u0417\u0430\u0434\u0430\u0447\", \"\u041f\u043e\u0442\u043e\u043a\u043e\u0432\", \"\u0412\u0440\u0435\u043c\u044f, \u0441\u0435\u043a.\", \"\u0417\u0430\u0434\u0430\u0447 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443\"]    )    benchmark_sheet.append(        [\"Jev 1.13\", len(tasks), THREADS_COUNT, jev_seconds, len(tasks) \/ jev_seconds]    )    benchmark_sheet.append(        [            \"DeepSeek\",            len(tasks),            THREADS_COUNT,            deepseek_seconds,            len(tasks) \/ deepseek_seconds,        ]    )    benchmark_sheet.freeze_panes = \"A2\"    benchmark_sheet.sheet_view.showGridLines = False    benchmark_sheet.column_dimensions[\"A\"].width = 18    benchmark_sheet.column_dimensions[\"B\"].width = 12    benchmark_sheet.column_dimensions[\"C\"].width = 12    benchmark_sheet.column_dimensions[\"D\"].width = 18    benchmark_sheet.column_dimensions[\"E\"].width = 22    for cell in benchmark_sheet[1]:        cell.fill = PatternFill(\"solid\", fgColor=\"1F4E78\")        cell.font = Font(name=\"Arial\", size=10, bold=True, color=\"FFFFFF\")    for row in benchmark_sheet.iter_rows(min_row=2, max_row=3):        for cell in row:            cell.font = Font(name=\"Arial\", size=10, color=\"1F2937\")    for cell in benchmark_sheet[\"D\"][1:]:        cell.number_format = \"0.00\"    for cell in benchmark_sheet[\"E\"][1:]:        cell.number_format = \"0.00\"    workbook.save(OUTPUT_FILE)    print(f\"Jev: {jev_seconds:.2f} \u0441\u0435\u043a., {len(tasks) \/ jev_seconds:.2f} \u0437\u0430\u0434\u0430\u0447\/\u0441\u0435\u043a.\")    print(        f\"DeepSeek: {deepseek_seconds:.2f} \u0441\u0435\u043a., \"        f\"{len(tasks) \/ deepseek_seconds:.2f} \u0437\u0430\u0434\u0430\u0447\/\u0441\u0435\u043a.\"    )    print(f\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d: {OUTPUT_FILE}\")if __name__ == \"__main__\":    main()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041c\u043e\u0434\u0435\u043b\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0412\u0440\u0435\u043c\u044f<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Jev 1.13<\/p>\n<\/td>\n<td>\n<p align=\"left\">12,46 \u0441\u0435\u043a.<\/p>\n<\/td>\n<td>\n<p align=\"left\">16,05 \u0437\u0430\u0434\u0430\u0447\/\u0441\u0435\u043a.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">DeepSeek structured output<\/p>\n<\/td>\n<td>\n<p align=\"left\">32,38 \u0441\u0435\u043a.<\/p>\n<\/td>\n<td>\n<p align=\"left\">6,18 \u0437\u0430\u0434\u0430\u0447\/\u0441\u0435\u043a.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u043c\u043e\u0451\u043c \u0442\u0435\u0441\u0442\u0435 Jev \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 <strong>2,6 \u0440\u0430\u0437\u0430<\/strong> \u0431\u044b\u0441\u0442\u0440\u0435\u0435 DeepSeek \u0441\u043e structured output. \u041e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0448\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 OpenRouter \u0432 10 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u0441\u0443\u0431\u044c\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e Deepseek \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043b\u0443\u0447\u0448\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u0435\u0435 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. <\/p>\n<h3>\u0415\u0441\u0442\u044c \u043b\u0438 \u0447\u0442\u043e \u0442\u043e \u0435\u0449\u0435 <\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043e\u0442 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u044f \u0441\u0442\u0430\u043b \u0434\u0443\u043c\u0430\u0442\u044c, \u0430 \u0435\u0441\u0442\u044c \u043b\u0438 \u0447\u0442\u043e \u0442\u043e \u0435\u0449\u0435 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. <\/p>\n<p>\u0418 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c.  \u0417\u0434\u0435\u0441\u044c \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e, \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c. \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u043b\u0430 \u0442\u0430\u043a \u0436\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.  \u0417\u0430 \u044d\u0442\u0438 \u043d\u0435\u0434\u0435\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u044b, \u043a\u0430\u043a \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 LLM, \u0442\u0430\u043a \u0438 \u043d\u0430 ModernBert. <\/p>\n<p><strong>\u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445<\/strong>: <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041c\u043e\u0434\u0435\u043b\u044c<\/p>\n<\/th>\n<th data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">\u041e\u0441\u043d\u043e\u0432\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0422\u0438\u043f<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Jev<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">\u0437\u0430\u043a\u0440\u044b\u0442\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 TypeSafe<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Laya<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">ModernBERT<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Decider<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Qwen3.5<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Nimble<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Qwen3.5-9B<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Kev<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Qwen + LoRA<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Plumb<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Qwen3.5-4B<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>SemIf<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Qwen<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>CLM<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Qwen3-8B<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Winnow-12B<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Gemma 4 12B<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 1 + System 2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Qwen 3.5 JSON<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">Qwen<\/p>\n<\/td>\n<td>\n<p align=\"left\">System 2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>ModernBERT NLI<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"147\" width=\"147\">\n<p align=\"left\">ModernBERT<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>Laya<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u043d\u0430 \u0447\u0442\u043e \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u2014 <a href=\"https:\/\/github.com\/he-jev\/laya\" rel=\"noopener nofollow\">Laya<\/a>.<\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, Laya  &#8212; \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 Jev, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0430\u0431\u0437\u0430\u0446\u0435 \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u0441 Jev. \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f decision model \u043d\u0430 \u0431\u0430\u0437\u0435 <strong>ModernBERT-large<\/strong>. \u0423 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u043a\u043e\u043b\u043e <strong>421 \u043c\u043b\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/strong>, \u043e\u043d\u0430 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0435 \u0436\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u0439: <code>choice<\/code>, <code>score<\/code> \u0438 <code>noul<\/code>.<\/p>\n<p><strong>\u041a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/strong> &#8212; Laya \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0434\u043e\u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u0437\u0430\u0434\u0430\u0447\u0438. \u0423 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f: <a href=\"https:\/\/laya-ai.com\/guides\/fine-tune-laya\" rel=\"noopener nofollow\">How to Fine-Tune Laya: RLCD Notebook, Calibration &amp; Custom Heads<\/a><\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043b\u044e\u0441 &#8212;  \u043d\u0438\u0437\u043a\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u0412 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434. \u0423 \u043c\u0435\u043d\u044f \u043d\u0430 GPU \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0431\u044b\u043b\u043e \u043e\u043a\u043e\u043b\u043e 30 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u0447\u0442\u043e \u0435\u0449\u0435 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Jev.  <\/p>\n<p><strong>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a <\/strong>&#8212; \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0431\u0430\u0437\u043e\u0432\u0430\u044f Laya \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0447 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0443\u0441\u0442\u0443\u043f\u0430\u0435\u0442 Jev. \u041d\u043e \u043f\u043e\u0441\u043b\u0435 fine-tuning \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0443\u0436\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0441 \u0441\u0430\u0439\u0442\u0430 Laya: <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/284\/290\/030\/2842900304cc08588687fa3842aa5963.png\" width=\"1281\" height=\"405\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/284\/290\/030\/2842900304cc08588687fa3842aa5963.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/284\/290\/030\/2842900304cc08588687fa3842aa5963.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Laya \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442:<\/p>\n<pre><code>pip install laya<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0418 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0435\u0441\u0430 ( \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435)<\/p>\n<pre><code class=\"python\">from laya import Routerrouter = Router(max_loaded=1, device=\"cpu\")questions = {    \"category\": {        \"type\": \"choice\",        \"instructions\": \"\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.\",        \"criteria\": {            \"\u043e\u043f\u043b\u0430\u0442\u0430\": \"\u0412\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430\u0445, \u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f\u0445 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430\u0445 \u0434\u0435\u043d\u0435\u0433.\",            \"\u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0430\": \"\u0412\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0435 \u0438 \u043c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u0437\u0430\u043a\u0430\u0437\u0430.\",            \"\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\": \"\u041e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043d\u0435\u043f\u043e\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0441\u0430\u0439\u0442\u0430.\",        },    }}result = router.predict(    \"\u0421 \u043c\u043e\u0435\u0433\u043e \u0441\u0447\u0451\u0442\u0430 \u0434\u0432\u0430\u0436\u0434\u044b \u0441\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u0435\u043d\u044c\u0433\u0438 \u0437\u0430 \u043e\u0434\u0438\u043d \u0437\u0430\u043a\u0430\u0437.\",    questions,    model=\"multilingual\",)print(result[\"answers\"][\"category\"][\"choice\"])<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h4>Decider<\/h4>\n<p><a href=\"https:\/\/github.com\/Mapika\/decider\" rel=\"noopener nofollow\">Decider<\/a> \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 <strong>Qwen3.5<\/strong>.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Decider-4B \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Qwen3.5-4B, \u043d\u043e \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0432\u0435\u0442. \u041c\u043e\u0434\u0435\u043b\u044c \u0431\u0435\u0440\u0451\u0442 logits \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u0432 probabilities.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u0430\u044f LLM, \u043d\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a System 1. <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a60\/d6e\/a1f\/a60d6ea1f54af3f4dce1b377a9aa56f3.png\" width=\"1672\" height=\"941\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a60\/d6e\/a1f\/a60d6ea1f54af3f4dce1b377a9aa56f3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a60\/d6e\/a1f\/a60d6ea1f54af3f4dce1b377a9aa56f3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>Nimble<\/h4>\n<p>\u0421\u044e\u0434\u0430 \u0436\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f Nimble \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0430\u044f <strong>Qwen3.5-9B<\/strong>.  \u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0435\u0437 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430. \u0410\u0432\u0442\u043e\u0440\u044b \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e\u0442 \u0432\u0435\u0441\u0430 \u0438 recipe \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0443\u044e LLM \u0434\u043e\u043e\u0431\u0443\u0447\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434 decision-\u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p><a href=\"https:\/\/github.com\/bespokelabsai\/nimble\" rel=\"noopener nofollow\">https:\/\/github.com\/bespokelabsai\/nimble<\/a><\/p>\n<h4>Kev  <\/h4>\n<p><a href=\"https:\/\/github.com\/jaredpalmer\/kev\" rel=\"noopener nofollow\">Kev<\/a> \u0442\u043e\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Qwen, \u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 <strong>LoRA + \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u044b\u0431\u043e\u0440\u0430. <\/strong><\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043e\u0442\u0434\u0435\u043b\u0451\u043d \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u044b \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0a7\/9f1\/5bc\/0a79f15bcf70bd58d57c1dfc8bad13f3.png\" width=\"1672\" height=\"941\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0a7\/9f1\/5bc\/0a79f15bcf70bd58d57c1dfc8bad13f3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0a7\/9f1\/5bc\/0a79f15bcf70bd58d57c1dfc8bad13f3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>Winnow-12B<\/h4>\n<p><a href=\"https:\/\/huggingface.co\/EldanRing\/Winnow-12B\" rel=\"noopener nofollow\">Winnow-12B<\/a> \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 <strong>Gemma 4 12B<\/strong> \u0438 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432 \u0434\u0432\u0443\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445:<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0432\u0435\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u043b\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0438 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c. \u041f\u043e \u043c\u043e\u0435\u043c\u0443 \u0441\u0443\u0431\u044c\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e \u044d\u0442\u043e \u0444\u0430\u0432\u043e\u0440\u0438\u0442 \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432. \u041e\u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0438\u043b\u0430 \u043c\u0435\u043d\u044f \u043a\u0430\u043a \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u0442\u0430\u043a \u0438 \u043f\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438. <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/17e\/e68\/f64\/17ee68f64061d265760ba9a2527ce126.png\" width=\"1672\" height=\"941\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/17e\/e68\/f64\/17ee68f64061d265760ba9a2527ce126.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/17e\/e68\/f64\/17ee68f64061d265760ba9a2527ce126.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p><strong>\u041c\u0435\u0442\u0440\u0438\u043a\u0438<\/strong><\/p>\n<p>\u041d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u044f \u043d\u0430\u0448\u0435\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 Jev. \u041c\u043d\u0435 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438 \u043c\u043e\u0439 Telegram, \u0433\u0434\u0435 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u043b\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (\u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f, \u0442\u0430\u043c \u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e AI): <a href=\"https:\/\/t.me\/+SDK1zExE10xmZmJi\" rel=\"noopener nofollow\">https:\/\/t.me\/+SDK1zExE10xmZmJi<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">Model<\/p>\n<\/th>\n<th>\n<p align=\"left\">Accuracy<\/p>\n<\/th>\n<th>\n<p align=\"left\">Correct \/ scored<\/p>\n<\/th>\n<th>\n<p align=\"left\">Not correct<\/p>\n<\/th>\n<th data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">Failed output or request<\/p>\n<\/th>\n<th>\n<p align=\"left\">Quality P50 \/ P95<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Jev 1.13<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>95.23%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">4 414 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">221<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">22 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">249 ms \/ 303 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Winnow 12B<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>94.61%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">4 385 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">250<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">00 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">52 ms \/ 83 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Decider 4B \u00b7 v2<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>94.46%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">4 378 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">257<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">55 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">45 ms \/ 152 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Nimble 9B<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>92.34%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">4 280 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">355<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">00 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">46 ms \/ 109 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Plumb 4B<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>89.54%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">4 150 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">485<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">00 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">40 ms \/ 131 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Qwen 3.5 \u00b7 JSON<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>85.78%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">3 976 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">659<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">00 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">291 ms \/ 904 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">SemIf 4B<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>81.70%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">3 787 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">848<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">00 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">43 ms \/ 116 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Laya<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>64.83%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">3 005 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 630<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">66 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">18 ms \/ 73 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Laya \u00b7 typed<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>63.91%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">2 962 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 673<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">55 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">17 ms \/ 72 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">ModernBERT \u00b7 NLI<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>58.73%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">2 722 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 913<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">00 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">17 ms \/ 48 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Laya \u00b7 multilingual<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>56.31%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">2 610 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">2 025<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">1515 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">16 ms \/ 64 ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">CLM 8B<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>36.09%<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">1 673 \/ 4 635<\/p>\n<\/td>\n<td>\n<p align=\"left\">2 962<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">00 invalid outputs included<\/p>\n<\/td>\n<td>\n<p align=\"left\">117 ms \/ 125 ms<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/www.youtube.com\/watch?v=zBw5BMrlZLo&amp;t=1s\" rel=\"noopener nofollow\">I Tested Jev vs 12 Self-Hosted AI Decision Models&#8230; &#8212; YouTube<\/a>  <\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432 Jev, \u043f\u0435\u0440\u0432\u0430\u044f \u043c\u044b\u0441\u043b\u044c \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439: \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442 &#8212; \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, routing \u0438 scoring \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0434\u0430\u0432\u043d\u043e. \u0418 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 &#171;<strong>\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435&#187;<\/strong> \u0432 \u0446\u0435\u043b\u043e\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u0435\u043c \u0436\u0435.  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u044f \u0431\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b, \u043f\u043e\u0447\u0435\u043c\u0443 Jev \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b. \u0412 \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0448\u043b\u0438\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0438\u0437\u043a\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c; &#8212; \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 <\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 <code>state<\/code> \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. <\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0442\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043e\u0431\u0443\u0447\u0438\u0442\u044c), \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u0439\u043c\u0443\u0442 \u043c\u0435\u0441\u0442\u043e \u0432 real time \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u0433\u0434\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u044f \u043d\u0435 \u0434\u0443\u043c\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b LLM \u0438\u0437 \u0437\u0430 \u0438\u0445 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438.  <\/p>\n<p><strong>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c!<\/strong><\/p>\n<p><a href=\"https:\/\/t.me\/+SDK1zExE10xmZmJi\" rel=\"noopener nofollow\"><strong>@ViacheslavVoo<\/strong><\/a><\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1088710\/\">https:\/\/habr.com\/ru\/articles\/1088710\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0432\u043e\u043a\u0440\u0443\u0433 \u043c\u043e\u0434\u0435\u043b\u0438 Jev \u0432 Ai-\u0441\u0444\u0435\u0440\u0435 \u043d\u0430\u0431\u0440\u0430\u043b \u0442\u0430\u043a\u0438\u0435 \u043e\u0431\u043e\u0440\u043e\u0442\u044b, \u0447\u0442\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0435\u0435 &#171;\u0443\u0431\u0438\u0439\u0446\u0435\u0439&#187; LLM, \u043d\u043e\u0432\u044b\u043c \u043f\u0440\u043e\u0440\u044b\u0432\u043e\u043c \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0438 \u043d\u0430\u0448\u0438\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a\u043e\u0432\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0433\u0434\u0435 \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Jev \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. \u042d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u0430\u044f LLM, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b, \u044d\u0442\u043e \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f decision model. \u0421\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 (TypeSafe) \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 System One Models  &#8212; \u043e\u0442\u0441\u044b\u043b\u043a\u0430 \u043a &#171;\u0421\u0438\u0441\u0442\u0435\u043c\u0435 1&#187; \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 \u0414\u0430\u043d\u0438\u044d\u043b\u044f \u041a\u0430\u043d\u0435\u043c\u0430\u043d\u0430: \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u043f\u043e\u0447\u0442\u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c \u0431\u0435\u0437 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439.  \u0422\u043e \u0435\u0441\u0442\u044c \u0441\u0430\u043c\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u0438 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0435\u0435 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c. \u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043d\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f: \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0434\u0430\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u044b\u0431\u043e\u0440 (choice), \u043e\u0446\u0435\u043d\u043a\u0443 (score) \u0438\u043b\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c (Noul). \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043d\u0430 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0438\u0441\u043a \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043e\u043f\u0440\u043e\u0441\u044b \u043a \u043e\u0434\u043d\u043e\u043c\u0443 state \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u041d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443 Jev \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0435 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u0437\u0430\u0434\u0430\u0447) \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0434\u043e 64K \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043d\u0430 \u0432\u0435\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 state + \u0432\u043e\u043f\u0440\u043e\u0441\u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 32K. \u041a\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Jev \u043f\u043e Api \u0447\u0435\u0440\u0435\u0437 OpenRouter: Jev 1.13 &#8212; API Pricing &amp; Providers | OpenRouter  \u0428\u0430\u0431\u043b\u043e\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u0441\u0432\u043e\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445: response = httpx.post(                &#171;https:\/\/openrouter.ai\/api\/alpha\/decisions&#187;,                headers={                    &#171;Authorization&#187;: f&#187;Bearer {\u043a\u043b\u044e\u0447}&#187;,                    &#171;Content-Type&#187;: &#171;application\/json&#187;,                },                json={                    &#171;model&#187;: JEV_MODEL,                    &#171;state&#187;: {                       &#171;&#187;                    },                    &#171;questions&#187;: {                        &#171;is_risky&#187;: {                            &#171;type&#187;: &#171;noul&#187;,                            &#171;instructions&#187;: (                                &#171;\u041e\u043f\u0430\u0441\u043d\u043e \u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c `tool_call` \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 &#187;                                &#171;\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 `messages`?&#187;                            ),                            &#171;criteria&#187;: {                                &#171;true&#187;: (                                    &#171;\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 &#187;                                    &#171;\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430\u0440\u0443\u0436\u0443 \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442.&#187;                                ),                                &#171;false&#187;: (                                    &#171;\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0438\u0447\u0435\u0433\u043e &#187;                                    &#171;\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432.&#187;                                ),                            },                        }                    },                },                timeout=60,            )            response.raise_for_status()            risk_probability = response.json()[&#171;answers&#187;][&#171;is_risky&#187;][&#171;noul&#187;]\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Claude code \/ Codex \/ Hermes \u0438 \u0442.\u0434 \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0443 Jev \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u0435\u0439\u0441\u043e\u0432 &#8212;  \u044d\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435, \u0442\u043e \u044d\u0442\u0438\u043c \u0432\u0441\u0451 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f: \u0441\u044e\u0434\u0430 \u0436\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f guardrails, reranking, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432.  \u041d\u043e \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:  \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 Codex \/ Claude code  \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0443\u044e \u0434\u043e\u0440\u043e\u0433\u0443\u044e \u0438 \u0441\u0438\u043b\u044c\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, GPT-6, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Jev \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043d\u0435 \u043b\u044e\u0431\u0438\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0432\u0430\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043b\u0438\u043c\u0438\u0442\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u0430\u0433\u0435\u043d\u0442\u0435. \u0421\u0445\u0435\u043c\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:\u0420\u043e\u043b\u044c Jev \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0439\u0434\u0451\u0442 \u0437\u0430\u043f\u0440\u043e\u0441. \u0412\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b.  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0438 \u043a\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u0447\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439)  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Jev \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0430\u0433\u0435\u043d\u0442\u043e\u0432\u041d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0435\u0439\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0430\u0433\u0435\u043d\u0442\u043e\u0432. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0432\u044b \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Jev \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0435\u0439\u0441\u044b:   \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 guardrail \u043f\u0435\u0440\u0435\u0434 tool call\u0414\u0443\u043c\u0430\u044e, \u0432\u0441\u0435 \u043c\u044b \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0443\u043c\u0430\u0435\u043c \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0430\u0433\u0435\u043d\u0442\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (\u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044d\u0442\u043e \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u043d\u0430\u044f \u043c\u0435\u0440\u0430) \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u0438\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0431\u044b \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e 1-1.5\u0441 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443  &#8212; \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e.  \u0417\u0434\u0435\u0441\u044c Jev \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u043a\u0430\u043a \u0437\u0430\u043c\u0435\u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u043c LLM. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043b\u0438 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043b\u0438 \u043d\u0435\u0442. \u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e langchain, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b middleware, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432: from collections.abc import Callableimport httpxfrom langchain.agents import create_agentfrom langchain.agents.middleware import AgentMiddleware, ToolCallRequestfrom langchain_core.messages import ToolMessagefrom langchain_core.tools import toolfrom langchain_openai import ChatOpenAIfrom config import DEEPSEEK_MODEL, JEV_MODEL, OPENROUTERclass JevGuardMiddleware(AgentMiddleware):    &#171;&#187;&#187;\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Jev \u0447\u0435\u0440\u0435\u0437 OpenRouter.&#187;&#187;&#187;    def wrap_tool_call(        self,        request: ToolCallRequest,        handler: Callable[[ToolCallRequest], ToolMessage],    ) -&gt; ToolMessage:        &#171;&#187;&#187;\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c tool call \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c.        Args:            request: \u0412\u044b\u0437\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u0430.            handler: \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.        Returns:            \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0435.        &#171;&#187;&#187;        try:            response = httpx.post(                &#171;https:\/\/openrouter.ai\/api\/alpha\/decisions&#187;,                headers={                    &#171;Authorization&#187;: f&#187;Bearer {OPENROUTER}&#187;,                    &#171;Content-Type&#187;: &#171;application\/json&#187;,                },                json={                    &#171;model&#187;: JEV_MODEL,                    &#171;state&#187;: {                        &#171;messages&#187;: [                            {                                &#171;role&#187;: message.type,                                &#171;content&#187;: message.content,                            }                            for message in request.state[&#171;messages&#187;]                        ],                        &#171;tool_call&#187;: request.tool_call,                        &#171;tool_description&#187;: request.tool.description,                    },                    &#171;questions&#187;: {                        &#171;is_risky&#187;: {                            &#171;type&#187;: &#171;noul&#187;,                            &#171;instructions&#187;: (                                &#171;\u041e\u043f\u0430\u0441\u043d\u043e \u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c `tool_call` \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 &#187;                                &#171;\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 `messages`?&#187;                            ),                            &#171;criteria&#187;: {                                &#171;true&#187;: (                                    &#171;\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 &#187;                                    &#171;\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430\u0440\u0443\u0436\u0443 \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442.&#187;                                ),                                &#171;false&#187;: (                                    &#171;\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0438\u0447\u0435\u0433\u043e &#187;                                    &#171;\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432.&#187;                                ),                            },                        }                    },                },                timeout=60,            )            response.raise_for_status()            risk_probability = response.json()[&#171;answers&#187;][&#171;is_risky&#187;][&#171;noul&#187;]        except (httpx.HTTPError, KeyError, TypeError, ValueError) as error:            print(f&#187;Jev \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d: {type(error).__name__}&#187;)            return ToolMessage(                content=(                    &#171;\u0412\u044b\u0437\u043e\u0432 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d: Jev \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c. &#187;                    &#171;\u041d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0439 \u0432\u044b\u0437\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.&#187;                ),                tool_call_id=request.tool_call[&#171;id&#187;],                name=request.tool_call[&#171;name&#187;],                status=&#187;error&#187;,            )        print(f&#187;\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0438\u0441\u043a\u0430 \u043f\u043e \u043e\u0446\u0435\u043d\u043a\u0435 Jev: {risk_probability:.2f}&#187;)        if risk_probability &gt;= 0.3:            return ToolMessage(                content=&#187;Jev \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0431\u044b\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d.&#187;,                tool_call_id=request.tool_call[&#171;id&#187;],                name=request.tool_call[&#171;name&#187;],                status=&#187;error&#187;,            )        return handler(request)@tooldef read_note(note_name: str) -&gt; str:    &#171;&#187;&#187;\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0443.    Args:        note_name: \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438.    Returns:        \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0438.    &#171;&#187;&#187;    return f&#187;\u0417\u0430\u043c\u0435\u0442\u043a\u0430 {note_name!r}: \u0432\u0441\u0442\u0440\u0435\u0447\u0430 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u043d\u0430 15:00.&#187;@tooldef delete_file(path: str) -&gt; str:    &#171;&#187;&#187;\u0411\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438.    Args:        path: \u041f\u0443\u0442\u044c \u043a \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.    Returns:        \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f.    Note:        \u0412 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e.    &#171;&#187;&#187;    return f&#187;\u0421\u0418\u041c\u0423\u041b\u042f\u0426\u0418\u042f: \u0444\u0430\u0439\u043b {path!r} \u043d\u0435 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0451\u043d.&#187;@tooldef send_email(recipient: str, text: str) -&gt; str:    &#171;&#187;&#187;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044e.    Args:        recipient: \u0410\u0434\u0440\u0435\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u043f\u0438\u0441\u044c\u043c\u0430.        text: \u0422\u0435\u043a\u0441\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430.    Returns:        \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438.    Note:        \u0412 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e.    &#171;&#187;&#187;    return f&#187;\u0421\u0418\u041c\u0423\u041b\u042f\u0426\u0418\u042f: \u043f\u0438\u0441\u044c\u043c\u043e \u0434\u043b\u044f {recipient!r} \u043d\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e. \u0422\u0435\u043a\u0441\u0442: {text!r}&#187;def main() -&gt; None:    &#171;&#187;&#187;\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u0433\u0435\u043d\u0442\u0430 \u0441 middleware \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.    Returns:        \u041d\u0438\u0447\u0435\u0433\u043e. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0430\u0433\u0435\u043d\u0442\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.    &#171;&#187;&#187;    agent =&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-496822","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/496822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=496822"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/496822\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=496822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=496822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=496822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}