{"id":480994,"date":"2026-05-25T20:33:25","date_gmt":"2026-05-25T20:33:25","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=480994"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=480994","title":{"rendered":"Capacitor: \u043e\u0442 \u0432\u0435\u0431\u0430 \u043a \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c. \u0427\u0430\u0441\u0442\u044c 4. \u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 LLM \u0432 \u043f\u0440\u043e\u0435\u043a\u0442"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Capacitor. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438, \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/982990\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 0. \u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d Capacitor<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/989296\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 1. \u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 Capacitor<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/1000690\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 2: \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/1013754\/\" rel=\"noopener noreferrer nofollow\">\u0427\u0430\u0441\u0442\u044c 3: OTA-\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u2014 \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0431\u0435\u0437 API-\u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0431\u0435\u0437 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 AI<\/h3>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u2014 \u044d\u0442\u043e \u043b\u0438\u0448\u043d\u044f\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c ChatGPT, Claude \u0438\u043b\u0438 Gemini, \u0437\u0430\u0447\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435? \u041d\u043e \u0443 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c\u0438.<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u043c\u0435\u0442\u043a\u0438, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0444\u043b\u0430\u0439\u043d. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043c\u0435\u0442\u0440\u043e, \u0432 \u0441\u0430\u043c\u043e\u043b\u0451\u0442\u0435 \u0438 \u0432 \u043c\u0435\u0441\u0442\u0430\u0445 \u0441 \u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430. \u0414\u0430\u0436\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u044d\u0442\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c. API-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0431\u044e\u0434\u0436\u0435\u0442\u0430, \u0438 \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u0440\u0430\u0437\u0443. \u0417\u0430 \u044d\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0431\u0430\u0442\u0430\u0440\u0435\u0435\u0439 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0436\u0435 \u0443\u043c\u0435\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0434\u0430\u0436\u0435 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445.<\/p>\n<h3>\u041a\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c<\/h3>\n<p>\u0414\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432: Gemma, Qwen \u0438 Phi. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0438\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442.<\/p>\n<h4>Gemma 3<\/h4>\n<p>Gemma 3 \u2014 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438:<\/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\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0414\u043b\u044f \u043a\u043e\u0433\u043e<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Gemma 3 270M<\/p>\n<\/td>\n<td>\n<p align=\"left\">270 \u043c\u043b\u043d<\/p>\n<\/td>\n<td>\n<p align=\"left\">~400 MB<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0411\u044b\u0441\u0442\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0441\u043b\u0430\u0431\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Gemma 3 1B<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 \u043c\u043b\u0440\u0434<\/p>\n<\/td>\n<td>\n<p align=\"left\">~1.2 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0411\u0430\u043b\u0430\u043d\u0441 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 LiteRT \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>.task<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0445 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445.<\/p>\n<h4>Gemma 4<\/h4>\n<p>Gemma 4 \u2014 \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0435 \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u0435, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430 edge-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0414\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u0438 E2B \u0438 E4B.<\/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\">\u042d\u0444\u0444. \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">RAM<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Gemma 4 E2B<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.3 \u043c\u043b\u0440\u0434<\/p>\n<\/td>\n<td>\n<p align=\"left\">&lt; 1.5 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0422\u0435\u043a\u0441\u0442, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0430\u0443\u0434\u0438\u043e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Gemma 4 E4B<\/p>\n<\/td>\n<td>\n<p align=\"left\">4.5 \u043c\u043b\u0440\u0434<\/p>\n<\/td>\n<td>\n<p align=\"left\">~3 GB<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0411\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430 \u043c\u043e\u0449\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441\u0442\u0430\u043b\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u043d\u0435\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f function calling.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 <code>.litertlm<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0451\u043b \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 <code>.task<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 Hugging Face: <a href=\"https:\/\/huggingface.co\/litert-community\/gemma-4-E2B-it-litert-lm\" rel=\"noopener noreferrer nofollow\">Gemma 4 E2B<\/a> \u0438 <a href=\"https:\/\/huggingface.co\/litert-community\/gemma-4-E4B-it-litert-lm\" rel=\"noopener noreferrer nofollow\">Gemma 4 E4B<\/a>.<\/p>\n<h4>Qwen3<\/h4>\n<p>Qwen3 \u043e\u0442 Alibaba \u0442\u043e\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u0432 on-device \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445. \u0423 \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0435\u0441\u0442\u044c LiteRT-\u0441\u0431\u043e\u0440\u043a\u0438, \u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/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\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0414\u043b\u044f \u043a\u043e\u0433\u043e<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Qwen3-0.6B<\/p>\n<\/td>\n<td>\n<p align=\"left\">600 \u043c\u043b\u043d<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0447\u0435\u043d\u044c \u043b\u0451\u0433\u043a\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Qwen3-1.7B<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.7 \u043c\u043b\u0440\u0434<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0411\u0430\u043b\u0430\u043d\u0441 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0423 Qwen3 \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u043b\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 thinking. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u0430 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u2014 \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435. \u0422\u0430\u043a\u0436\u0435 \u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 tool use \u0438 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h4>Phi-4 mini<\/h4>\n<p>Phi-4 mini \u2014 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0442 Microsoft, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0438 \u0430\u0433\u0435\u043d\u0442\u0441\u043a\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 LiteRT-LM, function calling \u0438 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u043e\u043d\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c. \u041d\u043e \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043b\u0451\u0433\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<h4>DeepSeek<\/h4>\n<p>DeepSeek \u0447\u0430\u0441\u0442\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u0432 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430\u0445 \u043f\u0440\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u043e \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u043e\u043d \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u043e\u043c \u0436\u0435 \u0441\u043c\u044b\u0441\u043b\u0435, \u0447\u0442\u043e Gemma \u0438\u043b\u0438 Qwen. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0430\u0436\u0435\u043d \u0438\u043c\u0435\u043d\u043d\u043e on-device \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0430 \u043d\u0435 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 DeepSeek \u0437\u0434\u0435\u0441\u044c \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0447\u043d\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e.<\/p>\n<h4>\u0427\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440, \u044f \u0431\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0410\u0433\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0447\u0430\u0442 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u2014 Gemma 4 E2B \u0438\u043b\u0438 Qwen3-1.7B.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043b\u0451\u0433\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 Qwen3-0.6B.<\/p>\n<\/li>\n<li>\n<p>\u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u2014 Phi-4 mini.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0443\u043b\u044c\u0442\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u2014 Gemma 4 E2B \u0438\u043b\u0438 E4B.<\/p>\n<\/li>\n<li>\n<p>\u0428\u0438\u0440\u043e\u043a\u0430\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u2014 Gemma 3 1B.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430 Android \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 LiteRT \u0438\u043b\u0438 LiteRT-LM, \u0430 \u043d\u0430 iOS \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 Apple Intelligence, \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0438 \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442.<\/p>\n<h3>\u041f\u043b\u0430\u0433\u0438\u043d @capgo\/capacitor-llm<\/h3>\n<p>\u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d <code>@capgo\/capacitor-llm<\/code>. \u041e\u043d \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 inference-\u0434\u0432\u0438\u0436\u043a\u0438 \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 Capacitor-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AI \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f:<\/p>\n<pre><code class=\"bash\">npm install @capgo\/capacitor-llmnpx cap sync<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Capacitor. \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Capgo \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b <code>createChat<\/code>, <code>sendMessage<\/code>, <code>getReadiness<\/code>, <code>setModel<\/code> \u0438 <code>downloadModel<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0438 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<h4>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/h4>\n<pre><code class=\"typescript\">getReadiness(): Promise&lt;{ ready: boolean }&gt;setModel(options: { model: string }): Promise&lt;void&gt;downloadModel(options: { url: string }): Promise&lt;void&gt;createChat(options?: { instructions?: string }): Promise&lt;{ chatId: string }&gt;sendMessage(options: { chatId: string; text: string }): Promise&lt;void&gt;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0442\u0432\u0435\u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e \u043c\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"typescript\">CapacitorLlm.addListener('textFromAi', (event: { text: string }) =&gt; { ... })CapacitorLlm.addListener('aiFinished', () =&gt; { ... })CapacitorLlm.addListener('downloadProgress', (event: { progress: number }) =&gt; { ... })CapacitorLlm.addListener('readinessChange', (event: { ready: boolean }) =&gt; { ... })<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439: UI \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d, \u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u0433\u043e \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0434\u0432\u0438\u0436\u043a\u0443, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0443.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Android<\/h3>\n<h4>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f SDK<\/h4>\n<p>\u0414\u043b\u044f Android \u0441\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c <code>minSdkVersion<\/code>. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0435 \u043d\u0438\u0436\u0435 24, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u043f\u0435\u0440\u0435\u0442\u044c\u0441\u044f \u0432 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<pre><code>ext {    minSdkVersion = 24}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0413\u0434\u0435 \u0432\u0437\u044f\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c<\/h4>\n<p>\u0414\u043b\u044f Gemma 3 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0431\u0440\u0430\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>.task<\/code>, \u0430 \u0434\u043b\u044f Gemma 4 \u2014 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>.litertlm<\/code>. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430: \u0443 \u043d\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0439 runtime \u0438 \u0440\u0430\u0437\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432 APK \u0438\u043b\u0438 AAB. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0434\u0435\u043c\u043e, \u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u042d\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0434\u043b\u044f production, \u0435\u0441\u043b\u0438 \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438:<\/p>\n<pre><code class=\"typescript\">await CapacitorLlm.downloadModel({  url: 'https:\/\/huggingface.co\/litert-community\/gemma-4-E2B-it-litert-lm'})<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0434\u0451\u0442\u0435 \u0432 assets, \u043f\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 <code>assets\/<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"typescript\">await CapacitorLlm.setModel({ model: 'gemma-4-E2B-it-int4.litertlm' })await CapacitorLlm.setModel({ model: 'gemma3-1b-it-int4.task' })<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 iOS<\/h3>\n<p>\u041d\u0430 iOS \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0449\u0435, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Apple Intelligence. \u042d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c: \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0451 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439.<\/p>\n<h4>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c<\/h4>\n<ul>\n<li>\n<p>iOS 18.2 \u0438 \u0432\u044b\u0448\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<\/li>\n<li>\n<p>\u042f\u0437\u044b\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 readiness.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 Apple Intelligence \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, <code>getReadiness()<\/code> \u0432\u0435\u0440\u043d\u0451\u0442 <code>false<\/code>, \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 \u0438\u043b\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 fallback.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043d\u0430 iOS, \u044d\u0442\u043e \u0443\u0436\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0438 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u0414\u043b\u044f \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044f \u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u043b \u043d\u0430 \u044d\u0442\u043e \u0441\u0442\u0430\u0432\u043a\u0443 \u043a\u0430\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443.<\/p>\n<h3>\u041f\u0438\u0448\u0435\u043c \u0447\u0430\u0442-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441: \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a production-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 self-contained \u0447\u0430\u0442 \u2014 \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435. \u0412\u043e\u0437\u044c\u043c\u0451\u043c React, \u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a. \u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 FSD \u0438 Zustand \u2014 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443.<\/p>\n<h4>\u0421\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438<\/h4>\n<p>\u0412\u044b\u043d\u0435\u0441\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441. \u0422\u0430\u043a \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"typescript\">import { CapacitorLlm } from '@capgo\/capacitor-llm'export type MessageRole = 'user' | 'assistant'export interface ChatMessage {  role: MessageRole  text: string}export class LlmService {  private chatId: string | null = null  async initialize(systemPrompt?: string): Promise&lt;void&gt; {    const { ready } = await CapacitorLlm.getReadiness()    if (!ready) {      throw new Error('LLM \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.')    }    const { chatId } = await CapacitorLlm.createChat({      instructions: systemPrompt,    })    this.chatId = chatId  }  async sendMessage(text: string): Promise&lt;void&gt; {    if (!this.chatId) {      throw new Error('\u0427\u0430\u0442 \u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435 initialize().')    }    await CapacitorLlm.sendMessage({ chatId: this.chatId, text })  }  onToken(callback: (token: string) =&gt; void) {    return CapacitorLlm.addListener('textFromAi', ({ text }) =&gt; callback(text))  }  onFinished(callback: () =&gt; void) {    return CapacitorLlm.addListener('aiFinished', callback)  }}export const llmService = new LlmService()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0425\u0443\u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/h4>\n<pre><code class=\"typescript\">import { useState, useEffect, useRef } from 'react'import { llmService, ChatMessage } from '.\/llm-service'export function useChat() {  const [messages, setMessages] = useState&lt;ChatMessage[]&gt;([])  const [isGenerating, setIsGenerating] = useState(false)  const [isReady, setIsReady] = useState(false)  const currentResponseRef = useRef('')  useEffect(() =&gt; {    \/\/ \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438: \u0447\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435 \u0440\u043e\u043b\u044c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f,      \/\/ \u0442\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u0435\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u041d\u0435 \u0436\u0430\u043b\u0435\u0439\u0442\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0435\u0433\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e.      llmService      .initialize('\u0422\u044b \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442. \u041e\u0442\u0432\u0435\u0447\u0430\u0439 \u043a\u0440\u0430\u0442\u043a\u043e \u0438 \u043f\u043e \u0434\u0435\u043b\u0443.')      .then(() =&gt; setIsReady(true))      .catch(console.error)    const tokenListener = llmService.onToken((token) =&gt; {      currentResponseRef.current += token      setMessages((prev) =&gt; {        const updated = [...prev]        if (updated.at(-1)?.role === 'assistant') {          updated[updated.length - 1] = {            role: 'assistant',            text: currentResponseRef.current,          }        }        return updated      })    })    const finishListener = llmService.onFinished(() =&gt; {      setIsGenerating(false)      currentResponseRef.current = ''    })    return () =&gt; {      tokenListener.then((l) =&gt; l.remove())      finishListener.then((l) =&gt; l.remove())    }  }, [])  const sendMessage = async (text: string) =&gt; {    if (!isReady || isGenerating) return    setMessages((prev) =&gt; [...prev, { role: 'user', text }])    setMessages((prev) =&gt; [...prev, { role: 'assistant', text: '' }])    setIsGenerating(true)    await llmService.sendMessage(text)  }  return { messages, isGenerating, isReady, sendMessage }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0430\u0442\u0430<\/h4>\n<pre><code class=\"typescript\">import React, { useState } from 'react'import { useChat } from '..\/model\/use-chat'export function Chat() {  const { messages, isGenerating, isReady, sendMessage } = useChat()  const [input, setInput] = useState('')  const handleSend = async () =&gt; {    if (!input.trim()) return    const text = input    setInput('')    await sendMessage(text)  }  if (!isReady) {    return (      &lt;div className=\"flex items-center justify-center h-full\"&gt;        &lt;p className=\"text-gray-500\"&gt;\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c...&lt;\/p&gt;      &lt;\/div&gt;    )  }  return (    &lt;div className=\"flex flex-col h-full\"&gt;      &lt;div className=\"flex-1 overflow-y-auto p-4 space-y-3\"&gt;        {messages.map((msg, i) =&gt; (          &lt;div            key={i}            className={`max-w-[80%] rounded-2xl px-4 py-2 text-sm ${              msg.role === 'user'                ? 'ml-auto bg-blue-500 text-white'                : 'mr-auto bg-gray-100 text-gray-900'            }`}          &gt;            {msg.text || (isGenerating ? '\u258c' : '')}          &lt;\/div&gt;        ))}      &lt;\/div&gt;      &lt;div className=\"p-4 border-t flex gap-2\"&gt;        &lt;input          className=\"flex-1 border rounded-xl px-3 py-2 text-sm outline-none\"          value={input}          onChange={(e) =&gt; setInput(e.target.value)}          onKeyDown={(e) =&gt; e.key === 'Enter' &amp;&amp; !isGenerating &amp;&amp; handleSend()}          placeholder=\"\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435...\"          disabled={isGenerating}        \/&gt;        &lt;button          className=\"px-4 py-2 bg-blue-500 text-white rounded-xl text-sm disabled:opacity-50\"          onClick={handleSend}          disabled={isGenerating || !input.trim()}        &gt;          {isGenerating ? '...' : '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c'}        &lt;\/button&gt;      &lt;\/div&gt;    &lt;\/div&gt;  )}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441. \u0418\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u043b\u043e.<\/p>\n<pre><code class=\"typescript\">import React, { useState } from 'react'import { CapacitorLlm } from '@capgo\/capacitor-llm'const MODEL_URL = 'https:\/\/your-cdn.com\/gemma3-1b-it-int4.task'export function ModelDownload({ onComplete }: { onComplete: () =&gt; void }) {  const [progress, setProgress] = useState(0)  const [isDownloading, setIsDownloading] = useState(false)  const startDownload = async () =&gt; {    setIsDownloading(true)    const listener = await CapacitorLlm.addListener(      'downloadProgress',      ({ progress }) =&gt; setProgress(Math.round(progress))    )    try {      await CapacitorLlm.downloadModel({ url: MODEL_URL })      onComplete()    } finally {      listener.remove()      setIsDownloading(false)    }  }  return (    &lt;div className=\"flex flex-col items-center justify-center h-full gap-6 p-8\"&gt;      &lt;h2 className=\"text-xl font-semibold text-center\"&gt;        \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c AI-\u043c\u043e\u0434\u0435\u043b\u044c      &lt;\/h2&gt;      &lt;p className=\"text-gray-500 text-sm text-center\"&gt;        Gemma 3 1B (~1.2 GB), \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437      &lt;\/p&gt;      {isDownloading ? (        &lt;div className=\"w-full max-w-xs\"&gt;          &lt;div className=\"h-2 bg-gray-200 rounded-full overflow-hidden\"&gt;            &lt;div              className=\"h-full bg-blue-500 transition-all duration-300\"              style={{ width: `${progress}%` }}            \/&gt;          &lt;\/div&gt;          &lt;p className=\"text-center text-sm text-gray-500 mt-2\"&gt;{progress}%&lt;\/p&gt;        &lt;\/div&gt;      ) : (        &lt;button          className=\"px-6 py-3 bg-blue-500 text-white rounded-xl\"          onClick={startDownload}        &gt;          \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c        &lt;\/button&gt;      )}    &lt;\/div&gt;  )}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u043a\u043b\u0430\u0441\u0441 <code>LlmService<\/code> \u0438 \u0445\u0443\u043a <code>useChat<\/code>. \u0414\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0430\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438, \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u044f\u0432\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443: \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043f\u043b\u0430\u0433\u0438\u043d \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>LlmGateway<\/code>, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0447\u0435\u0440\u0435\u0437 Zustand \u0438 \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0442 UI. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0435\u0433\u043e \u043f\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 PaperFlow.<\/p>\n<p>PaperFlow \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430, \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u044b \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043e \u0441\u0440\u043e\u043a\u0430\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0412 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 AI \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d: \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0438\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0438\u0447\u0438<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f FSD, \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u0451 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0440\u0435\u0437 \u0432 <code>features<\/code>.<\/p>\n<pre><code>src\/  features\/    document-assistant\/      model\/        types.ts        contracts.ts        context-builder.ts        use-cases.ts        store.ts        hooks.ts      api\/        llm-gateway.ts      ui\/        AssistantSheet.tsx        MessageBubble.tsx      index.ts<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442 AI-\u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u043f\u0440\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430, \u0430 \u0441\u0430\u043c \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0434.<\/p>\n<h4>\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442<\/h4>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0447\u0442\u043e\u0431\u044b UI \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<pre><code class=\"typescript\">export type AssistantMessage = {  role: 'user' | 'assistant'  text: string}export interface LlmGateway {  initialize(systemPrompt: string): Promise&lt;void&gt;  sendMessage(text: string): Promise&lt;void&gt;  onToken(cb: (token: string) =&gt; void): Promise&lt;() =&gt; void&gt;  onFinished(cb: () =&gt; void): Promise&lt;() =&gt; void&gt;  getReadiness(): Promise&lt;boolean&gt;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u043b\u044e\u0437\u0430<\/h4>\n<pre><code class=\"typescript\">import { CapacitorLlm } from '@capgo\/capacitor-llm'import { LlmGateway } from '..\/model\/contracts'export const createCapacitorLlmGateway = (): LlmGateway =&gt; {  let chatId: string | null = null  return {    async getReadiness() {      const { ready } = await CapacitorLlm.getReadiness()      return ready    },    async initialize(systemPrompt) {      const { chatId: id } = await CapacitorLlm.createChat({        instructions: systemPrompt,      })      chatId = id    },    async sendMessage(text) {      if (!chatId) throw new Error('LLM \u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430')      await CapacitorLlm.sendMessage({ chatId, text })    },    async onToken(cb) {      const listener = await CapacitorLlm.addListener('textFromAi', ({ text }) =&gt; cb(text))      return () =&gt; listener.remove()    },    async onFinished(cb) {      const listener = await CapacitorLlm.addListener('aiFinished', cb)      return () =&gt; listener.remove()    },  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<pre><code class=\"typescript\">import { Document } from '@\/entities\/documents'const formatDocument = (doc: Document): string =&gt; {  const parts = [`\u2014 \"${doc.title}\"`]  if (doc.categoryId) {    parts.push(`\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f: ${doc.categoryId}`)  }  if (doc.expiresAt) {    const expiresDate = new Date(doc.expiresAt).toLocaleDateString('ru-RU')    const daysLeft = Math.ceil(      (new Date(doc.expiresAt).getTime() - Date.now()) \/ (1000 * 60 * 60 * 24)    )    if (daysLeft &lt;= 0) {      parts.push(`\u0438\u0441\u0442\u0451\u043a ${expiresDate}`)    } else {      parts.push(`\u0438\u0441\u0442\u0435\u043a\u0430\u0435\u0442 ${expiresDate} (\u0447\u0435\u0440\u0435\u0437 ${daysLeft} \u0434\u043d.)`)    }  } else {    parts.push('\u0431\u0435\u0437 \u0441\u0440\u043e\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f')  }  if (doc.tagIds.length &gt; 0) {    parts.push(`\u0442\u0435\u0433\u0438: ${doc.tagIds.join(', ')}`)  }  return parts.join(' ')}export const buildDocumentContext = (documents: Document[]) =&gt; {  const active = documents.filter((d) =&gt; !d.archived)  const today = new Date().toLocaleDateString('ru-RU')  const docList =    active.length &gt; 0 ? active.map(formatDocument).join('\\n') : '\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043a\u0430 \u043d\u0435\u0442'  const systemPrompt = `\u0422\u044b \u2014 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f PaperFlow \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.\u0421\u0435\u0433\u043e\u0434\u043d\u044f: ${today}.\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:${docList}\u041f\u0440\u0430\u0432\u0438\u043b\u0430:1. \u041e\u0442\u0432\u0435\u0447\u0430\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.2. \u0415\u0441\u043b\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435, \u0447\u0435\u0441\u0442\u043d\u043e \u0441\u043a\u0430\u0436\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c.3. \u041e\u0442\u0432\u0435\u0447\u0430\u0439 \u043a\u0440\u0430\u0442\u043a\u043e \u0438 \u043f\u043e \u0434\u0435\u043b\u0443.4. \u041d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u043d\u0435 \u0442\u0435\u043c\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0435\u0436\u043b\u0438\u0432\u043e \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0439.`.trim()  return { systemPrompt }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u042e\u0437-\u043a\u0435\u0439\u0441\u044b \u0438 \u0441\u0442\u043e\u0440<\/h4>\n<pre><code class=\"typescript\">import { LlmGateway } from '.\/contracts'import { buildDocumentContext } from '.\/context-builder'import { Document } from '@\/entities\/documents'export const initializeAssistant = async (  gateway: LlmGateway,  documents: Document[]): Promise&lt;void&gt; =&gt; {  const ready = await gateway.getReadiness()  if (!ready) {    throw new Error('LOCAL_LLM_NOT_READY')  }  const { systemPrompt } = buildDocumentContext(documents)  await gateway.initialize(systemPrompt)}export const sendAssistantMessage = async (  gateway: LlmGateway,  text: string): Promise&lt;void&gt; =&gt; {  await gateway.sendMessage(text)}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code class=\"typescript\">import { create } from 'zustand'import { createCapacitorLlmGateway } from '..\/api\/llm-gateway'import { initializeAssistant, sendAssistantMessage } from '.\/use-cases'import { AssistantMessage } from '.\/contracts'import { Document } from '@\/entities\/documents'type AssistantStatus = 'idle' | 'initializing' | 'ready' | 'generating' | 'unavailable'type AssistantStore = {  status: AssistantStatus  messages: AssistantMessage[]  initialize: (documents: Document[]) =&gt; Promise&lt;void&gt;  send: (text: string) =&gt; Promise&lt;void&gt;  appendToken: (token: string) =&gt; void  finishGeneration: () =&gt; void}const gateway = createCapacitorLlmGateway()export const useAssistantStore = create&lt;AssistantStore&gt;((set, get) =&gt; ({  status: 'idle',  messages: [],  initialize: async (documents) =&gt; {    set({ status: 'initializing' })    try {      await initializeAssistant(gateway, documents)      await gateway.onToken((token) =&gt; get().appendToken(token))      await gateway.onFinished(() =&gt; get().finishGeneration())      set({ status: 'ready' })    } catch {      set({ status: 'unavailable' })    }  },  send: async (text) =&gt; {    if (get().status !== 'ready') return    set((s) =&gt; ({      status: 'generating',      messages: [        ...s.messages,        { role: 'user', text },        { role: 'assistant', text: '' },      ],    }))    await sendAssistantMessage(gateway, text)  },  appendToken: (token) =&gt; {    set((s) =&gt; {      const messages = [...s.messages]      const last = messages.at(-1)      if (last?.role === 'assistant') {        messages[messages.length - 1] = {          role: 'assistant',          text: last.text + token,        }      }      return { messages }    })  },  finishGeneration: () =&gt; {    set({ status: 'ready' })  },}))\/\/ \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0447\u0430\u0442\u0430 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 createChat \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043b\u0438\u0441\u0442\u0430.\/\/ \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0439\u0442\u0435 messages \u0432 AsyncStorage \u0438\u043b\u0438 SQLite \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0439\u0442\u0435\/\/ \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0437\u0430\u043d\u043e\u0432\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435.<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u044d\u043a\u0440\u0430\u043d\u0443<\/h4>\n<pre><code class=\"typescript\">import { useEffect } from 'react'import { useDocumentsStore } from '@\/entities\/documents'import { useAssistantStore } from '.\/store'export const useDocumentAssistant = () =&gt; {  const documents = useDocumentsStore((s) =&gt; s.documents)  const { status, messages, initialize, send } = useAssistantStore()  useEffect(() =&gt; {    if (status === 'idle') {      initialize(documents)    }  }, [status, documents, initialize])  return { status, messages, send }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code class=\"typescript\">import { useState } from 'react'import { useDocumentAssistant } from '@\/features\/document-assistant'import { AssistantSheet } from '@\/features\/document-assistant'export function HomeToolbar() {  const [open, setOpen] = useState(false)  const { status } = useDocumentAssistant()  return (    &lt;&gt;      &lt;button        onClick={() =&gt; setOpen(true)}        disabled={status === 'initializing' || status === 'unavailable'}        className=\"p-2 rounded-full bg-gray-100\"        aria-label=\"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430\"      &gt;        \u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430      &lt;\/button&gt;      &lt;AssistantSheet open={open} onClose={() =&gt; setOpen(false)} \/&gt;    &lt;\/&gt;  )}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f (<code>status === 'initializing'<\/code>), \u043a\u043d\u043e\u043f\u043a\u0430 \u0437\u0430\u0434\u0438\u0437\u0435\u0439\u0431\u043b\u0435\u043d\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u0447\u0430\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/00\/4f\/e0\/004fe073f93698f1a5f1f745fb4762c3.png\" alt=\"\u041c\u043e\u0434\u0435\u043b\u044c \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430 \u2014 \u00ab\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c...\u00bb \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u044d\u043a\u0440\u0430\u043d\u0430, \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u00bb \u0437\u0430\u0434\u0438\u043c\u043b\u0435\u043d\u0430\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/00\/4f\/e0\/004fe073f93698f1a5f1f745fb4762c3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/00\/4f\/e0\/004fe073f93698f1a5f1f745fb4762c3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041c\u043e\u0434\u0435\u043b\u044c \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430 \u2014 \u00ab\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c&#8230;\u00bb \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u044d\u043a\u0440\u0430\u043d\u0430, \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u00bb \u0437\u0430\u0434\u0438\u043c\u043b\u0435\u043d\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e <code>status<\/code> \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 <code>ready<\/code> \u2014 \u0447\u0430\u0442 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435, \u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/af\/5a\/64\/af5a645c5514cdd71a8d59ff0cd6ba74.png\" alt=\"\u0414\u0438\u0430\u043b\u043e\u0433 \u0441 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043e\u043c \u2014 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/af\/5a\/64\/af5a645c5514cdd71a8d59ff0cd6ba74.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/af\/5a\/64\/af5a645c5514cdd71a8d59ff0cd6ba74.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0414\u0438\u0430\u043b\u043e\u0433 \u0441 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043e\u043c \u2014 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435<\/figcaption><\/div>\n<\/figure>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<p>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 AI \u0432 Capacitor-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0444\u043b\u0430\u0439\u043d \u0438 \u043d\u0435 \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0437\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a API.<\/p>\n<p>\u041c\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u043f\u0443\u0442\u044c \u043e\u0442 \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0444\u0438\u0447\u0438: \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u043e\u0434 Android \u0438 iOS, \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0447\u0430\u0442, \u0432\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0435\u0440\u043d\u0443\u043b\u0438 \u0432\u0441\u0451 \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u2014 Gemma 4 E2B, Qwen3-1.7B, Phi-4 mini \u2014 \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f CI\/CD \u0434\u043b\u044f Capacitor. \u041d\u0430 \u044d\u0442\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0435. \u041f\u0438\u0448\u0438\u0442\u0435 \u043b\u044e\u0431\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u0432 \u043b\u0438\u0447\u043a\u0443.<\/p>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/vk.com\/sudondie\" rel=\"noopener noreferrer nofollow\">VK<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/sudondie\" rel=\"noopener noreferrer nofollow\">Telegram<\/a><\/p>\n<\/li>\n<\/ul>\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\/1039318\/\">https:\/\/habr.com\/ru\/articles\/1039318\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Capacitor. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438, \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043d\u0438\u0445:\u0427\u0430\u0441\u0442\u044c 0. \u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d Capacitor\u0427\u0430\u0441\u0442\u044c 1. \u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 Capacitor\u0427\u0430\u0441\u0442\u044c 2: \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d\u0427\u0430\u0441\u0442\u044c 3: OTA-\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u2014 \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0431\u0435\u0437 API-\u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0431\u0435\u0437 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.\u0417\u0430\u0447\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 AI\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u2014 \u044d\u0442\u043e \u043b\u0438\u0448\u043d\u044f\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c ChatGPT, Claude \u0438\u043b\u0438 Gemini, \u0437\u0430\u0447\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435? \u041d\u043e \u0443 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c\u0438.\u041f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u043c\u0435\u0442\u043a\u0438, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.\u041e\u0444\u043b\u0430\u0439\u043d. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043c\u0435\u0442\u0440\u043e, \u0432 \u0441\u0430\u043c\u043e\u043b\u0451\u0442\u0435 \u0438 \u0432 \u043c\u0435\u0441\u0442\u0430\u0445 \u0441 \u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e.\u0417\u0430\u0434\u0435\u0440\u0436\u043a\u0430. \u0414\u0430\u0436\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u044d\u0442\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f.\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c. API-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0431\u044e\u0434\u0436\u0435\u0442\u0430, \u0438 \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432.\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u0440\u0430\u0437\u0443. \u0417\u0430 \u044d\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0431\u0430\u0442\u0430\u0440\u0435\u0435\u0439 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0436\u0435 \u0443\u043c\u0435\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0434\u0430\u0436\u0435 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445.\u041a\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c\u0414\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432: Gemma, Qwen \u0438 Phi. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0438\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442.Gemma 3Gemma 3 \u2014 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438:\u041c\u043e\u0434\u0435\u043b\u044c\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b\u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430\u0414\u043b\u044f \u043a\u043e\u0433\u043eGemma 3 270M270 \u043c\u043b\u043d~400 MB\u0411\u044b\u0441\u0442\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0441\u043b\u0430\u0431\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430Gemma 3 1B1 \u043c\u043b\u0440\u0434~1.2 GB\u0411\u0430\u043b\u0430\u043d\u0441 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438\u042d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 LiteRT \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .task, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0445 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445.Gemma 4Gemma 4 \u2014 \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0435 \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u0435, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430 edge-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0414\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u0438 E2B \u0438 E4B.\u041c\u043e\u0434\u0435\u043b\u044c\u042d\u0444\u0444. \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044bRAM\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043eGemma 4 E2B2.3 \u043c\u043b\u0440\u0434&lt; 1.5 GB\u0422\u0435\u043a\u0441\u0442, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0430\u0443\u0434\u0438\u043eGemma 4 E4B4.5 \u043c\u043b\u0440\u0434~3 GB\u0411\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430 \u043c\u043e\u0449\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e:\u041c\u043e\u0434\u0435\u043b\u044c \u0441\u0442\u0430\u043b\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u043d\u0435\u0435.\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c.\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f function calling.\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 .litertlm, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0451\u043b \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 .task.\u041c\u043e\u0434\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 Hugging Face: Gemma 4 E2B \u0438 Gemma 4 E4B.Qwen3Qwen3 \u043e\u0442 Alibaba \u0442\u043e\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u0432 on-device \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445. \u0423 \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0435\u0441\u0442\u044c LiteRT-\u0441\u0431\u043e\u0440\u043a\u0438, \u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.\u041c\u043e\u0434\u0435\u043b\u044c\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b\u0414\u043b\u044f \u043a\u043e\u0433\u043eQwen3-0.6B600 \u043c\u043b\u043d\u041e\u0447\u0435\u043d\u044c \u043b\u0451\u0433\u043a\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438Qwen3-1.7B1.7 \u043c\u043b\u0440\u0434\u0411\u0430\u043b\u0430\u043d\u0441 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e\u0423 Qwen3 \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u043b\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 thinking. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u0430 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u2014 \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435. \u0422\u0430\u043a\u0436\u0435 \u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 tool use \u0438 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c.Phi-4 miniPhi-4 mini \u2014 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0442 Microsoft, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0438 \u0430\u0433\u0435\u043d\u0442\u0441\u043a\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 LiteRT-LM, function calling \u0438 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u043e\u043d\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c. \u041d\u043e \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043b\u0451\u0433\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.DeepSeekDeepSeek \u0447\u0430\u0441\u0442\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u0432 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430\u0445 \u043f\u0440\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u043e \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u043e\u043d \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u043e\u043c \u0436\u0435 \u0441\u043c\u044b\u0441\u043b\u0435, \u0447\u0442\u043e Gemma \u0438\u043b\u0438 Qwen. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0430\u0436\u0435\u043d \u0438\u043c\u0435\u043d\u043d\u043e on-device \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0430 \u043d\u0435 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 DeepSeek \u0437\u0434\u0435\u0441\u044c \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0447\u043d\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e.\u0427\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440, \u044f \u0431\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0442\u0430\u043a:\u0410\u0433\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0447\u0430\u0442 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u2014 Gemma 4 E2B \u0438\u043b\u0438 Qwen3-1.7B.\u0421\u0430\u043c\u044b\u0439 \u043b\u0451\u0433\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 Qwen3-0.6B.\u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u2014 Phi-4 mini.\u041c\u0443\u043b\u044c\u0442\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u2014 Gemma 4 E2B \u0438\u043b\u0438 E4B.\u0428\u0438\u0440\u043e\u043a\u0430\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u2014 Gemma 3 1B.\u041d\u0430 Android \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 LiteRT \u0438\u043b\u0438 LiteRT-LM, \u0430 \u043d\u0430 iOS \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 Apple Intelligence, \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0438 \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442.\u041f\u043b\u0430\u0433\u0438\u043d @capgo\/capacitor-llm\u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d @capgo\/capacitor-llm. \u041e\u043d \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 inference-\u0434\u0432\u0438\u0436\u043a\u0438 \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 Capacitor-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AI \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f:npm install @capgo\/capacitor-llmnpx cap sync\u041f\u043b\u0430\u0433\u0438\u043d \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Capacitor. \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Capgo \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b createChat, sendMessage, getReadiness, setModel \u0438 downloadModel, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043b\u044f \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0438 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044bgetReadiness(): Promise&lt;{ ready: boolean }&gt;setModel(options: { model: string }): Promise&lt;void&gt;downloadModel(options: { url: string }): Promise&lt;void&gt;createChat(options?: { instructions?: string }): Promise&lt;{ chatId: string }&gt;sendMessage(options: { chatId: string; text: string }): Promise&lt;void&gt;\u041e\u0442\u0432\u0435\u0442\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e \u043c\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430:CapacitorLlm.addListener(&#8216;textFromAi&#8217;, (event: { text: string }) =&gt; { &#8230; })CapacitorLlm.addListener(&#8216;aiFinished&#8217;, () =&gt; { &#8230; })CapacitorLlm.addListener(&#8216;downloadProgress&#8217;, (event: { progress: number }) =&gt; { &#8230; })CapacitorLlm.addListener(&#8216;readinessChange&#8217;, (event: { ready: boolean }) =&gt; { &#8230; })\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439: UI \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d, \u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u0433\u043e \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0434\u0432\u0438\u0436\u043a\u0443, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0443.\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Android\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f SDK\u0414\u043b\u044f Android \u0441\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c minSdkVersion. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0435 \u043d\u0438\u0436\u0435 24, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u043f\u0435\u0440\u0435\u0442\u044c\u0441\u044f \u0432 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.ext {    minSdkVersion = 24}\u0413\u0434\u0435 \u0432\u0437\u044f\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c\u0414\u043b\u044f Gemma 3 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0431\u0440\u0430\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .task, \u0430 \u0434\u043b\u044f Gemma 4 \u2014 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .litertlm. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430: \u0443 \u043d\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0439 runtime \u0438 \u0440\u0430\u0437\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438.\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:\u0412\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432 APK \u0438\u043b\u0438 AAB. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0434\u0435\u043c\u043e, \u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0431\u043e\u0440\u043a\u0438.\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u042d\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0434\u043b\u044f production, \u0435\u0441\u043b\u0438 \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438:await CapacitorLlm.downloadModel({  url: &#8216;https:\/\/huggingface.co\/litert-community\/gemma-4-E2B-it-litert-lm&#8217;})\u0415\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0434\u0451\u0442\u0435 \u0432 assets, \u043f\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 assets\/. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:await CapacitorLlm.setModel({ model: &#8216;gemma-4-E2B-it-int4.litertlm&#8217; })await CapacitorLlm.setModel({ model: &#8216;gemma3-1b-it-int4.task&#8217; })\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 iOS\u041d\u0430 iOS \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0449\u0435, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Apple Intelligence. \u042d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c: \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0451 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439.\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044ciOS 18.2 \u0438 \u0432\u044b\u0448\u0435.\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e.\u042f\u0437\u044b\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 readiness.\u0415\u0441\u043b\u0438 Apple Intelligence \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, getReadiness() \u0432\u0435\u0440\u043d\u0451\u0442 false, \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 \u0438\u043b\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 fallback.\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u043d\u0430 iOS, \u044d\u0442\u043e \u0443\u0436\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0438 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u0414\u043b\u044f \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044f \u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u043b \u043d\u0430 \u044d\u0442\u043e \u0441\u0442\u0430\u0432\u043a\u0443 \u043a\u0430\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443.\u041f\u0438\u0448\u0435\u043c \u0447\u0430\u0442-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441: \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a production-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 self-contained \u0447\u0430\u0442 \u2014 \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435. \u0412\u043e\u0437\u044c\u043c\u0451\u043c React, \u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a. \u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 FSD \u0438 Zustand \u2014 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443.\u0421\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0412\u044b\u043d\u0435\u0441\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441. \u0422\u0430\u043a \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.import { CapacitorLlm } from &#8216;@capgo\/capacitor-llm&#8217;export type MessageRole = &#8216;user&#8217; | &#8216;assistant&#8217;export interface ChatMessage {  role: MessageRole  text: string}export class LlmService {  private chatId: string | null = null  async initialize(systemPrompt?: string): Promise&lt;void&gt; {    const { ready } = await CapacitorLlm.getReadiness()    if (!ready) {      throw new Error(&#8216;LLM \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.&#8217;)    }    const { chatId } = await CapacitorLlm.createChat({      instructions: systemPrompt,    })    this.chatId = chatId  }  async sendMessage(text: string): Promise&lt;void&gt; {    if (!this.chatId) {      throw new Error(&#8216;\u0427\u0430\u0442 \u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435 initialize().&#8217;)    }    await CapacitorLlm.sendMessage({ chatId: this.chatId, text })  }  onToken(callback: (token: string) =&gt; void) {    return CapacitorLlm.addListener(&#8216;textFromAi&#8217;, ({ text }) =&gt; callback(text))  }  onFinished(callback: () =&gt; void) {    return CapacitorLlm.addListener(&#8216;aiFinished&#8217;, callback)  }}export const llmService = new LlmService()\u0425\u0443\u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044fimport { useState, useEffect, useRef } from &#8216;react&#8217;import { llmService, ChatMessage } from &#8216;.\/llm-service&#8217;export function useChat() {  const [messages, setMessages] = useState&lt;ChatMessage[]&gt;([])  const [isGenerating, setIsGenerating] = useState(false)  const [isReady, setIsReady] = useState(false)  const currentResponseRef = useRef(&#187;)  useEffect(() =&gt; {    \/\/ \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438: \u0447\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435 \u0440\u043e\u043b\u044c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f,      \/\/ \u0442\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u0435\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u041d\u0435 \u0436\u0430\u043b\u0435\u0439\u0442\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0435\u0433\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e.      llmService      .initialize(&#8216;\u0422\u044b \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442. \u041e\u0442\u0432\u0435\u0447\u0430\u0439 \u043a\u0440\u0430\u0442\u043a\u043e \u0438 \u043f\u043e \u0434\u0435\u043b\u0443.&#8217;)      .then(() =&gt; setIsReady(true))      .catch(console.error)    const tokenListener = llmService.onToken((token) =&gt; {      currentResponseRef.current += token      setMessages((prev) =&gt; {        const updated = [&#8230;prev]        if (updated.at(-1)?.role === &#8216;assistant&#8217;) {          updated[updated.length &#8212; 1] = {            role: &#8216;assistant&#8217;,            text: currentResponseRef.current,          }        }        return updated      })    })    const finishListener = llmService.onFinished(() =&gt; {      setIsGenerating(false)      currentResponseRef.current = &#187;    })    return () =&gt; {&#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-480994","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480994","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=480994"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480994\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}