{"id":459543,"date":"2025-05-14T09:00:38","date_gmt":"2025-05-14T09:00:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=459543"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=459543","title":{"rendered":"<span>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0438\u00a0\u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 LLM. \u0427\u0430\u0441\u0442\u044c\u00a02: \u0441\u043a\u0440\u0438\u043f\u0442 vLLM, Ray Serve \u0434\u043b\u044f\u00a0\u0432\u044b\u0432\u043e\u0434\u0430 API \u0438\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 KubeRay Cluster<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e vLLM \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043c\u0443 \u0447\u0435\u0440\u0435\u0437 Ray Serve. \u0410 \u0435\u0449\u0451 \u0432\u044b\u044f\u0441\u043d\u0438\u043c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c Gemma 3 \u0432 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0438 \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e OpenAI-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0430 \u0441 JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d83\/c54\/b5b\/d83c54b5b3a6d52293222dd89a01dd79.png\" width=\"1879\" height=\"1080\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d83\/c54\/b5b\/d83c54b5b3a6d52293222dd89a01dd79.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d83\/c54\/b5b\/d83c54b5b3a6d52293222dd89a01dd79.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0441\u0442\u043e\u0438\u0442 <a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/906700\/\">\u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043d\u0435\u0451<\/a>. \u0422\u0430\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u00ab\u0436\u0435\u043b\u0435\u0437\u043e\u00bb \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0441 Ray Serve \u0438 vLLM.<\/p>\n<p><a class=\"anchor\" name=\"vllm\" id=\"vllm\"><\/a><\/p>\n<h3>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 vLLM \u0434\u043b\u044f \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 Ray Serve \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 API<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b API.<\/p>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 vLLM \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0432\u044b\u0431\u0440\u0430\u043d<\/h4>\n<p><a href=\"https:\/\/github.com\/vllm-project\/vllm\">vLLM<\/a> \u2014 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p><strong>\u041d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong> (tensor parallel): \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u0442\u0435\u043d\u0437\u043e\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0435\u0436\u0434\u0443 GPU \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0439\u043f\u043b\u0430\u0439\u043d-\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c<\/strong> (pipeline parallel): \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438-\u0441\u043b\u043e\u0438 \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0445 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u043d\u043e\u0434\u0430\u043c: \u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u043b\u043e\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 GPU \u043d\u043e\u0434\u044b \u0410, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u2014 \u043d\u0430 GPU \u043d\u043e\u0434\u044b B \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u043d\u043e\u0434\u0430 \u0410 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u043e\u0434\u0430 B \u0443\u0436\u0435 \u0434\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u2014 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 NVIDIA Collective Communications Library<\/strong> (NCCL), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u0435\u0440\u0445\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043e\u0431\u043c\u0435\u043d \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 GPU \u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u043e\u0434\u0430\u043c\u0438 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e RDMA\/InfiniBand), \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u044f \u0432\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043b.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b<\/strong>: \u043e\u0442\u0434\u0430\u0451\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u043c\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u0430\u043a \u0432 OpenAI ChatCompletion API, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u044d\u0442\u043e \u0434\u0430\u0451\u0442 \u043d\u0430\u043c:<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u0443\u044e \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u044c: \u0432\u0441\u0435 VRAM-\u043a\u0430\u0440\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435, \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044f \u0441\u0432\u043e\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443: \u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u0440\u0442\u0435 \u0438\u0434\u0443\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u044e\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb: \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, 1 \u0438\u043b\u0438 8 GPU \u043d\u0430 \u043d\u043e\u0434\u0435 \u0438 \u043a\u0430\u043a\u043e\u0432\u043e \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0434, vLLM + NCCL \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043b\u044e\u0431\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u0445 \u043a\u0430\u0440\u0442.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 vLLM \u0437\u0430\u0434\u0430\u0451\u043c:<\/p>\n<ol>\n<li>\n<p><strong>Tensor parallel size<\/strong> \u2014 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u00ab\u043a\u0443\u0441\u043e\u0447\u043a\u043e\u0432\u00bb \u0432\u0435\u0441\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e GPU \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0437\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>Pipeline parallel size<\/strong> \u2014 \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0434\u0438\u0439 \u0434\u0440\u043e\u0431\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e \u043d\u043e\u0434\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p><strong>gpu_memory_utilization<\/strong> \u0438 <strong>cpu_offload_gb<\/strong> \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u044a\u0451\u043c\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u043e\u0441\u0442\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a \u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440.<\/p>\n<p><a class=\"anchor\" name=\"rayserve\" id=\"rayserve\"><\/a><\/p>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Ray Serve<\/h4>\n<p><a href=\"https:\/\/docs.ray.io\/en\/latest\/serve\/index.html\">Ray Serve<\/a> \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Ray, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c FastAPI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u2014 \u043a\u0430\u0436\u0434\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0443\u0437\u043b\u0435, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 GPU, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Ray Serve, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 HTTP API, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 OpenAI-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430\u043c\u0438 (ChatCompletion). \u0427\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 API \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0441\u043c\u043e\u0433\u0443\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043c\u043e\u0434\u0435\u043b\u0438, \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u043e\u0439 \u0432 vLLM.<\/p>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u0435<\/h4>\n<ol>\n<li>\n<p><strong>\u0412\u043d\u0443\u0442\u0440\u0438 \u0443\u0437\u043b\u0430. <\/strong>Tensor Parallelism \u0434\u0440\u043e\u0431\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043a\u0443\u0441\u043a\u0438, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u0445 \u043d\u0430 \u0432\u0441\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 GPU \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NCCL \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u00ad\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438. <\/strong>Pipeline Parallelism \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0441 GPU \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440: \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u00ab\u0441\u0442\u0430\u0434\u0438\u044e\u00bb \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0442\u0430\u043a \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0435\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. <\/strong>Ray Serve \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u044e \u044d\u0442\u0443 \u043c\u043e\u0449\u044c \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 HTTP-\u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e OpenAI-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443. \u041e\u043d \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0435 \u0448\u0430\u0440\u0434-\u0433\u0440\u0443\u043f\u043f\u044b, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 GPU \u0438 \u043d\u043e\u0434\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/h4>\n<blockquote>\n<p>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: \u044f \u043d\u0435 Python-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 production-ready \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<\/blockquote>\n<p><strong>\u0421\u043a\u0440\u0438\u043f\u0442 serve.py<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/serve.py\">serve.py<\/a>. \u0412 \u043d\u0451\u043c:<\/p>\n<ul>\n<li>\n<p>\u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f vLLM \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 (tensor parallel, pipeline parallel \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435);<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f FastAPI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f ChatCompletion \u2014 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u043e\u0433\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<\/li>\n<li>\n<p>Ray Serve \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0421\u043a\u0440\u0438\u043f\u0442 auth.py<\/strong><\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/auth.py\">auth.py<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 JWT \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0440\u0451\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u043b\u043e\u0433\u0438\u043d, \u0440\u043e\u043b\u044c, \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f) \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, USER_LIST);<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u043e\u043b\u0438 (admin\/user) \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0436\u0438\u0437\u043d\u0438 \u0442\u043e\u043a\u0435\u043d\u0430.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 <code>serve.py<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0430\u043c. \u0415\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0430 (\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u043e\u0432, \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0438 \u0440\u043e\u043b\u0435\u0439) \u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c.<\/p>\n<\/blockquote>\n<h3>\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0438\u0442\u043e\u0433\u0438\u00a0<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p><code>serve.py<\/code>\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0433\u0434\u0435 Ray Serve \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 FastAPI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 vLLM \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c;<\/p>\n<\/li>\n<li>\n<p><code>auth.py<\/code>\u00a0\u2014 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u0438\u043c \u0434\u0432\u0443\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441, \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0438\u043c\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 Docker-\u043e\u0431\u0440\u0430\u0437 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0451 \u0432 KubeRay.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 KubeRay<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c Docker-\u043e\u0431\u0440\u0430\u0437, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 Registry \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c Ray Cluster \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CephFS \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c CPU- \u0438 GPU-\u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u044f \u0431\u0435\u0440\u0443 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Docker-\u043e\u0431\u0440\u0430\u0437 Ray, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437.<\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 Docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 Registry<\/h4>\n<p><strong>1. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Ray:\u00a0<\/strong><\/p>\n<ul>\n<li>\n<p>\u0411\u0435\u0440\u0451\u043c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Ray \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>rayproject\/ray:2.44.0-py310-cu124<\/code>. \u041e\u043d \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Ray, CUDA-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 Python 3.10.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043f\u0430\u043a\u0435\u0442\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c <code>serve.py<\/code>, <code>auth.py<\/code> (\u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044f \u0432\u0441\u0451 \u0432 zip-\u0430\u0440\u0445\u0438\u0432).<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>vLLM<\/code>, <code>httpx<\/code>, <code>PyJWT<\/code> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<p><strong>3. \u0421\u0431\u043e\u0440\u043a\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0438\u0448\u0435\u043c Dockerfile (<a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/dockerfile.ray\">dockerfile.ray<\/a>), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 zip-\u0444\u0430\u0439\u043b\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 pip-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Make (<a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/Makefile\">Makefile<\/a>) \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">make package-container<\/code><\/pre>\n<p><strong>4. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0443\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 Registry \u2014 DockerHub, GitLab Registry \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">docker push gitlab.example.com:5050\/it-operations\/k8s-config\/vllm-0.8.4-ray-2.44.0-py310-cu124-serve:1.1.7<\/code><\/pre>\n<ul>\n<li>\n<p>\u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e Kubernetes-\u0443\u0437\u043b\u044b \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u043e\u043c\u0443 Registry. \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 Deckhouse <a href=\"https:\/\/deckhouse.ru\/products\/kubernetes-platform\/documentation\/v1\/modules\/node-manager\/faq.html#%D0%BA%D0%B0%D0%BA-%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C-%D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8E-%D0%B2-%D0%B4%D0%BE%D0%BF%D0%BE%D0%BB%D0%BD%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9-registry\">\u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/a> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 registry, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043d\u0435\u0433\u043e.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 KubeRay Cluster<\/h4>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c Ray Cluster \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Helm-\u0447\u0430\u0440\u0442\u0430 \u0438 values-\u0444\u0430\u0439\u043b\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0442\u0430\u043a\u0430\u044f:<\/p>\n<ul>\n<li>\n<p><strong>head<\/strong> (\u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0443\u0437\u0435\u043b)\u00a0\u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 Ray Head Pod \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c Ray Dashboard, Autoscaler, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0443\u0436\u0435\u043d, \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 worker&#8217;\u0430\u043c\u0438. \u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0436\u0438\u043c\u0430 HA \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.ray.io\/en\/latest\/cluster\/kubernetes\/user-guides\/kuberay-gcs-ft.html#gcs-fault-tolerance-in-kuberay\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f<\/a> <code>gcsFaultToleranceOptions<\/code> \u2014 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>worker<\/strong>\u00a0\u2014 1+ \u043f\u043e\u0434\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 CPU \u0438\u043b\u0438 GPU.<\/p>\n<\/li>\n<li>\n<p><strong>additionalWorkerGroups<\/strong>\u00a0\u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0433\u0440\u0443\u043f\u043f\u044b worker&#8217;\u043e\u0432 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0430\u0431\u044b\u0439 GPU).<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/argo-projects\/kube-ray\/charts\/ray-cluster\/ap-values.yaml\">ap-values.yaml<\/a> \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438.<\/p>\n<p><strong>1. image<\/strong><\/p>\n<pre><code class=\"yaml\">image:   repository: gitlab.example.com:5050\/it-operations\/k8s-config\/vllm-0.8.4-ray-2.44.0-py310-cu124-serve   tag: 1.1.7   pullPolicy: IfNotPresent<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><code>repository<\/code> \u0438 <code>tag<\/code> \u2014 \u044d\u0442\u043e Docker-\u043e\u0431\u0440\u0430\u0437, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435;<\/p>\n<\/li>\n<li>\n<p><code>pullPolicy: IfNotPresent<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e Kubernetes \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u043e\u0432\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437, \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. imagePullSecrets<\/strong><\/p>\n<pre><code class=\"yaml\">imagePullSecrets:   - name: regcred<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 Registry \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442 (credential).<\/p>\n<p><strong>3. common<\/strong><\/p>\n<pre><code class=\"yaml\">common:   containerEnv:     - name: HF_HOME       value: \"\/data\/model-cache\"     - name: DTYPE       value: \"bfloat16\"     - name: GPU_MEMORY_UTIL       value: \"0.98\"     - name: MAX_MODEL_LEN       value: \"131072\"<\/code><\/pre>\n<p><code>containerEnv<\/code> \u0437\u0430\u0434\u0430\u0451\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0438 \u0432 head, \u0438 \u0432 worker:<\/p>\n<ul>\n<li>\n<p><code>DTYPE<\/code> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, float16) \u2014 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0435;<\/p>\n<\/li>\n<li>\n<p><code>GPU_MEMORY_UTIL<\/code> \u2014 \u0434\u043e\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 vLLM;<\/p>\n<\/li>\n<li>\n<p><code>MAX_MODEL_LEN<\/code> \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 (\u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438).<\/p>\n<\/li>\n<\/ul>\n<p><strong>4. head<\/strong><\/p>\n<pre><code class=\"yaml\">head:   rayVersion: \"2.44.0\"   enableGcsFT: true     gcsFT:     # externalStorageNamespace: ray-gcs-backup       redisAddress: redis:6379                             redisSecret:         name: redis-password-secret         key: password   labels:     component: ray-head   serviceAccountName: \"sa-deepseek-cluster\"   rayStartParams:     dashboard-host: \"0.0.0.0\"     num-cpus: \"0\"     metrics-export-port: \"8080\"   containerEnv:     - name: RAY_PROMETHEUS_HOST       value: https:\/\/prometheus.d8-monitoring:9090   envFrom:     - secretRef:         name: auth-config   resources:     limits:       cpu: \"6\"       memory: \"8G\"     requests:       cpu: \"3\"       memory: \"4G\"   volumes:     - name: model-cache       persistentVolumeClaim:         claimName: model-cache-pvc   volumeMounts:     - mountPath: \/data\/model-cache       name: model-cache<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><code>rayVersion<\/code> \u2014 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Ray \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Autoscaler&#8217;\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d in-tree Autoscaling;<\/p>\n<\/li>\n<li>\n<p><code>serviceAccountName<\/code> \u2014 ServiceAccount, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043f\u043e\u0434\u0443. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a PV, Secret \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p><code>envFrom<\/code> \u2014 \u0431\u0435\u0440\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 Secret auth-config. \u042d\u0442\u043e \u043b\u043e\u0433\u0438\u043d\u044b, \u043f\u0430\u0440\u043e\u043b\u0438, JWT-\u043a\u043b\u044e\u0447\u0438;<\/p>\n<\/li>\n<li>\n<p><code>resources<\/code> \u2014 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043b\u0438\u043c\u0438\u0442\u044b CPU\/RAM \u0434\u043b\u044f head-\u043f\u043e\u0434\u0430. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435: \u043b\u0438\u043c\u0438\u0442 6\u00a0CPU, 8GiB\u00a0RAM;<\/p>\n<\/li>\n<li>\n<p><code>volumes<\/code><strong> <\/strong>\/ <code>volumeMounts<\/code> \u2014 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 CephFS (\u0447\u0435\u0440\u0435\u0437 PVC model-cache-pvc) \u043d\u0430 \u043f\u0443\u0442\u044c <code>\/data\/model-cache<\/code>, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f head.<\/p>\n<\/li>\n<\/ul>\n<p><strong>HA-\u0440\u0435\u0436\u0438\u043c GCS (GCS Fault Tolerance)<\/strong><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043e\u0442\u043a\u0430\u0437\u0430 (GCS Head), \u043c\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 Redis:<\/p>\n<ul>\n<li>\n<p><code>enableGcsFT: true<\/code> \u2014 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Helm-\u0448\u0430\u0431\u043b\u043e\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0446\u0438\u044e <code>gcsFaultToleranceOptions<\/code>. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u043b\u0430\u0433\u0430 \u0435\u0449\u0451 \u043d\u0435\u0442 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0447\u0430\u0440\u0442\u0435 <a href=\"https:\/\/github.com\/ray-project\/kuberay\/tree\/master\/helm-chart\/ray-cluster\">RayCluster<\/a>.<\/p>\n<\/li>\n<li>\n<p><code>gcsFT.redisAddress: redis:6379<\/code> \u2014 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e Redis-\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0443\u0431\u043b\u0438 GCS-\u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><code>gcsFT.redisSecret.name\/key<\/code> \u2014 Kubernetes Secret \u0441 \u0443\u0447\u0451\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a Redis, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u00ab\u043f\u043b\u0430\u0432\u0430\u043b\u00bb \u0432 YAML.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b<\/strong><\/p>\n<p>\u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 GCS head \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0432\u043e\u0438 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u2014 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043d\u043e \u0438 \u0432 Redis. \u0415\u0441\u043b\u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 head-\u043f\u043e\u0434 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u044f, \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0439 head \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u0432 Redis \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.<\/p>\n<p><strong>5. worker<\/strong><\/p>\n<pre><code class=\"yaml\">worker:   groupName: rtx-3090   replicas: 2   minReplicas: 2   maxReplicas: 2   resources:     limits:       cpu: \"16\"       memory: \"24G\"       nvidia.com\/gpu: \"1\"     requests:       cpu: \"8\"       memory: \"12G\"       nvidia.com\/gpu: \"1\"   nodeSelector:     node.deckhouse.io\/group: \"w-gpu\"   tolerations:     - key: \"dedicated.apiac.ru\"       operator: \"Equal\"       value: \"w-gpu\"       effect: \"NoExecute\"   volumes:     - name: model-cache       persistentVolumeClaim:         claimName: model-cache-pvc   volumeMounts:     - mountPath: \/data\/model-cache       name: model-cache<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><code>groupName<\/code> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b worker&#8217;\u043e\u0432 (<code>rtx-3090<\/code>);<\/p>\n<\/li>\n<li>\n<p><code>replicas<\/code> \u0438 <code>minReplicas<\/code>\/<code>maxReplicas<\/code> \u2014 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043e\u0432 worker \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 \u043a\u0430\u043a\u043e\u0439 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d;<\/p>\n<\/li>\n<li>\n<p><code>resources<\/code> \u2014 \u043b\u0438\u043c\u0438\u0442\u044b CPU\/Memory \u0438 GPU. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1 \u043a\u0430\u0440\u0442\u0430 \u043d\u0430 \u043f\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p><code>nodeSelector<\/code> \u0438 <code>tolerations<\/code> \u2014 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c worker&#8217;\u044b \u043d\u0430 \u0443\u0437\u043b\u0430\u0445 \u0441 \u043b\u0435\u0439\u0431\u043b\u043e\u043c <code>node.deckhouse.io\/group=w-gpu<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>volumes<\/code><strong> <\/strong>\/<strong> <\/strong><code>volumeMounts<\/code> \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e head \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c PVC \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<\/li>\n<\/ul>\n<p><strong>6. additionalWorkerGroups<\/strong><\/p>\n<pre><code class=\"yaml\">additionalWorkerGroups:   rtx-3060:     disabled: true     replicas: 1     minReplicas: 1     maxReplicas: 1     nodeSelector:       node.deckhouse.io\/group: \"w-gpu-3060\"     ...<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f, \u043a\u0430\u0436\u0434\u0430\u044f\u00a0\u2014 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u043b\u0435\u0439\u0431\u043b\u0430\u043c\u0438, affinities \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0415\u0441\u043b\u0438 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c, \u0441\u0442\u0430\u0432\u0438\u043c <code>disabled: true<\/code>, \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.\u00a0<\/p>\n<h3>\u0420\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 Ray Application. \u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u0434\u0435\u043b\u0438 Gemma 3 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 API<\/h3>\n<p>Gemma 3 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0435\u0440\u0435\u0434\u043e\u0432\u044b\u0445 LLM \u043e\u0442 Google, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 <a href=\"https:\/\/huggingface.co\/google\/gemma-3-12b-it\">\u043d\u0430 Hugging Face<\/a>. \u041e\u043d\u0430 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u043a\u0441\u0442\u0430\u043c\u0438 (\u0434\u043e 128K \u0442\u043e\u043a\u0435\u043d\u043e\u0432) \u0438 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c. \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435 LLM.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043a\u0430\u043a \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e OpenAI-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0430 \u0441 JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439.<\/p>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 Ray Application<\/h4>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Ray Application. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 Ray Serve, \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u0440\u0430\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438 \u043f\u043e\u0434 \u043a\u0430\u043a\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (tensor\/pipeline) \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 JSON-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a Ray Dashboard<\/h4>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 <code>https:\/\/ray-dashboard.k8s.example.com\/api\/serve\/applications\/<\/code> \u0441 \u0442\u0435\u043b\u043e\u043c:<\/p>\n<pre><code class=\"json\">{   \"applications\": [     {       \"import_path\": \"serve:model\",       \"name\": \"Gemma-3-12b\",       \"route_prefix\": \"\/\",       \"autoscaling_config\": {         \"min_replicas\": 1,         \"initial_replicas\": 1,         \"max_replicas\": 1       },       \"deployments\": [         {           \"name\": \"VLLMDeployment\",           \"num_replicas\": 1,           \"ray_actor_options\": {},           \"deployment_ready_timeout_s\": 1200         }       ],       \"runtime_env\": {         \"working_dir\": \"file:\/\/\/home\/ray\/serve.zip\",          \"env_vars\": {            \"MODEL_ID\": \"google\/gemma-3-12b-it\",            \"TENSOR_PARALLELISM\": \"1\",            \"PIPELINE_PARALLELISM\": \"2\",            \"MODEL_NAME\": \"gemma-3-12b\",            \"MAX_MODEL_LEN\": \"131072\",            \"MAX_NUM_SEQS\": \"256\",            \"ENABLE_ENFORCE_EAGER\": \"true\",            \"CPU_OFFLOAD_GB\": \"0\",            \"DTYPE\": \"auto\",        \"VLLM_USE_V1\": \"1\",            \"GPU_MEMORY_UTIL\": \"0.98\"          }       }     }   ] }<\/code><\/pre>\n<h4>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b JSON-\u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/h4>\n<p><strong>1.<\/strong> <strong>import_path<\/strong>: <code>\"serve:model\"<\/code><\/p>\n<ul>\n<li>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 Ray, \u0447\u0442\u043e \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 (working_dir) \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f Python-\u043c\u043e\u0434\u0443\u043b\u044c <code>serve.py<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u043e\u0431\u044a\u0435\u043a\u0442 <code>model<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a Ray Serve Deployment.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. name<\/strong>: <code>\"Gemma-3-12b\"<\/code><\/p>\n<ul>\n<li>\n<p>\u0418\u043c\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 Ray Dashboard, \u0447\u0442\u043e\u0431\u044b \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445.<\/p>\n<\/li>\n<\/ul>\n<p><strong>3. route_prefix<\/strong>: <code>\"\/\"<\/code><\/p>\n<ul>\n<li>\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 Ingress \u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>4. <strong>autoscaling_config<\/strong><\/p>\n<ul>\n<li>\n<p><code>min_replicas<\/code>, <code>initial_replicas<\/code>, <code>max_replicas<\/code> \u0437\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 1 \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0441\u043a\u0435\u0439\u043b\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>5. <strong>deployments<\/strong><\/p>\n<ul>\n<li>\n<p>\u0417\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d <code>VLLMDeployment<\/code> \u0441 num_replicas = 1. \u042d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\/\u043e\u0431\u0451\u0440\u0442\u043a\u0430 vLLM \u0432 <code>serve.py<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>deployment_ready_timeout_s = 1200<\/code> \u0434\u0430\u0451\u0442 \u0432\u0440\u0435\u043c\u044f (20 \u043c\u0438\u043d\u0443\u0442) \u043d\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>6. <strong>runtime_env<\/strong><\/p>\n<ul>\n<li>\n<p><code>working_dir: \"file:\/\/\/home\/ray\/serve.zip\"<\/code> \u0433\u043e\u0432\u043e\u0440\u0438\u0442 Ray, \u0433\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 \u043a\u043e\u0434\u00a0\u2014 \u0441\u043a\u0440\u0438\u043f\u0442\u044b <code>serve.py<\/code>, <code>auth.py<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>env_vars:<\/code> \u0437\u0430\u0434\u0430\u0451\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f vLLM:<\/p>\n<ul>\n<li>\n<p><code>\"MODEL_ID\"<\/code>\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 Hugging Face, \u0437\u0434\u0435\u0441\u044c <code>\"google\/gemma-3-12b-it\"<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>\"TENSOR_PARALLELISM\"<\/code> \u0438 <code>\"PIPELINE_PARALLELISM\"<\/code>\u00a0\u2014 \u0440\u0435\u0433\u043b\u0430\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043d\u0443\u044e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c ( <code>\"TENSOR_PARALLELISM\": \"1\"<\/code>\u00a0\u2014 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435 1\u00a0GPU, <code>\"PIPELINE_PARALLELISM\": \"2\"<\/code>\u00a0\u2014 2\u00a0GPU \u0432\u0441\u0435\u0433\u043e \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435);<\/p>\n<\/li>\n<li>\n<p><code>\"MODEL_NAME\"<\/code>\u00a0\u2014 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 API \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p><code>\"MAX_MODEL_LEN\"<\/code>\u00a0\u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u0442\u043e\u043a\u0435\u043d\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432 \u0447\u0430\u0440\u0442\u0435 Ray Cluster;<\/p>\n<\/li>\n<li>\n<p><code>\"MAX_NUM_SEQS\"<\/code>\u00a0\u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0441\u0441\u0438\u0439\/\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p><code>\"ENABLE_ENFORCE_EAGER\"<\/code>\u00a0\u2014 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 eager-\u0440\u0435\u0436\u0438\u043c\u0430 \u0432 vLLM \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0434\u0435\u0431\u0430\u0433\u0430;<\/p>\n<\/li>\n<li>\n<p><code>\"CPU_OFFLOAD_GB\"<\/code>\u00a0\u2014 \u043e\u0431\u044a\u0451\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 (GB), \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u043e\u0434 \u043e\u0444\u043b\u043e\u0430\u0434 \u0447\u0430\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0441 GPU \u043d\u0430 CPU;<\/p>\n<\/li>\n<li>\n<p><code>\"DTYPE\"<\/code>\u00a0\u2014 \u0432\u044b\u0431\u043e\u0440 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 (bfloat16\/float32 \u0438 \u0442.\u0434.) \u0434\u043b\u044f \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432 \u0447\u0430\u0440\u0442\u0435 Ray Cluster;<\/p>\n<\/li>\n<li>\n<p><code>\"VLLM_USE_V1\"<\/code> \u2014 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0434\u0432\u0438\u0436\u043e\u043a \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 vLLM V1 \u0441 \u0435\u0434\u0438\u043d\u044b\u043c \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u043e\u043c \u0437\u0430\u0434\u0430\u0447, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c KV-\u043a\u044d\u0448\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438, \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p><code>\"GPU_MEMORY_UTIL\"<\/code>\u00a0\u2014 \u0434\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438 (98 %) \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432 \u0447\u0430\u0440\u0442\u0435 Ray Cluster.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u043f\u043b\u043e\u044f \u0438 \u0432\u0438\u0434 \u0432 Ray Dashboard<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 Ray:<\/p>\n<ol>\n<li>\n<p>\u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0438\u0437 <code>serve.zip<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 Ray Serve Application \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c <code>Gemma-3-12b<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Deployments \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>VLLMDeployment<\/code>. vLLM \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u044f <code>Gemma-3-12b<\/code> \u0438\u0437 Hugging Face.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a vLLM \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c Gemma 3 \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u043f\u0440\u0438\u0451\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 OpenAI-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>\/v1\/chat\/completions<\/code>), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (tensor\/pipeline), \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432 <code>env_vars<\/code>.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/63b\/d7d\/43f\/63bd7d43f4a5fe8f17e83f96e8d6b69b.png\" width=\"1600\" height=\"918\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/63b\/d7d\/43f\/63bd7d43f4a5fe8f17e83f96e8d6b69b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/63b\/d7d\/43f\/63bd7d43f4a5fe8f17e83f96e8d6b69b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 API \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h4>\n<p><strong>1. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/strong><\/p>\n<p>\u0412 Kubernetes \u0441\u043e\u0437\u0434\u0430\u0451\u043c Secret (<a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/auth.yaml\">auth.yaml<\/a>) \u0441 JWT-\u043a\u043b\u044e\u0447\u043e\u043c, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (\u043b\u043e\u0433\u0438\u043d\u044b, \u0440\u043e\u043b\u0438, \u0445\u044d\u0448\u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439).<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 auth.yaml:<\/p>\n<pre><code class=\"yaml\">apiVersion: v1 kind: Secret metadata:   name: auth-config   namespace: kuberay-projects type: Opaque data:   JWT_KEY: ZGVmYXVsdF9qd3RfS2V5   ACCESS_TOKEN_EXPIRE_MINUTES: NjA=   SKIP_EXP_CHECK: ZmFsc2U=   HUGGING_FACE_HUB_TOKEN: \"\"   USER_LIST: QUxJQ0UsIEJPQg==   ALICE_USERNAME: YWxpY2U=   ALICE_HASHED_PASSWORD: ZmFrZWhhc2hlZGhhc2g=   ALICE_ROLE: YWRtaW4=   BOB_USERNAME: Ym9i   BOB_HASHED_PASSWORD: ZmFrZWhhc2hlZGhhc2g=   BOB_ROLE: Z3Vlc3Q=<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f ALICE_HASHED_PASSWORD \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0443\u0436\u0435 \u00ab<abbr class=\"habraabbr\" title=\"\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043f\u0430\u0440\u043e\u043b\u044e \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.\" data-title=\"&lt;p&gt;\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043f\u0430\u0440\u043e\u043b\u044e \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.&lt;\/p&gt;\" data-abbr=\"\u0421\u043e\u043b\u044c \u043f\u0430\u0440\u043e\u043b\u044f\">\u0441\u043e\u043b\u044c<\/abbr>\u00a0+\u00a0\u0445\u044d\u0448\u00bb \u043f\u0430\u0440\u043e\u043b\u044f.<\/p>\n<p><strong>2. \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0438 \u0445\u044d\u0448\u0430<\/strong><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Python-\u0441\u043a\u0440\u0438\u043f\u0442 <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/gen_pwd.py\">gen_pwd.py<\/a>, \u0433\u0434\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>secrets.token_hex<\/code> \u0438 <code>hashlib.sha256<\/code> \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0441\u043e\u043b\u0438 \u0438 \u0445\u044d\u0448\u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439. \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 <code>PASSWORD<\/code> \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>ALICE_HASHED_PASSWORD<\/code>. \u0421\u043e\u043b\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 <code>JWT_KEY<\/code>. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b <code>auth.py<\/code> \u043c\u043e\u0433 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0438 \u043a\u043b\u044e\u0447\u0430 JWT \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f \u0441\u043e\u043b\u044c, \u043d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p><strong>3. \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 JWT<\/strong><\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 <code>\/token<\/code>, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f username \/ password \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>form-data<\/code>:<\/p>\n<pre><code class=\"bash\">curl --location 'https:\/\/openai-api.example.com\/token' \\   --form 'username=\"admin\"' \\   --form 'password=\"password\"'<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442:<\/p>\n<pre><code class=\"json\">{   \"access_token\": \"&lt;\u0442\u043e\u043a\u0435\u043d&gt;\",   \"token_type\": \"bearer\" }<\/code><\/pre>\n<p><strong>4. \u0412\u044b\u0437\u043e\u0432 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430<\/strong>\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 API \u0441\u0430\u043c \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441, \u0437\u0430\u0434\u0430\u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u043e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439:<\/p>\n<pre><code class=\"bash\">curl --location 'https:\/\/openai-api.example.com\/v1\/chat\/completions' \\ --header 'Content-Type: application\/json' \\ --header 'Authorization: Bearer &lt;\u0442\u043e\u043a\u0435\u043d&gt;' \\ --data '{   \"model\": \"Gemma-3-12b\",   \"messages\": [     {       \"role\": \"user\",       \"content\": \"\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0442\u0432\u0435\u0440\u0433\u043e\u0432 \u0432 \u043c\u0430\u0440\u0442\u0435 2025 \u0433\u043e\u0434\u0430?\"     }   ],   \"stream\": false,   \"max_tokens\": 2000,   \"temperature\": 0.85,   \"top_p\": 0.95,   \"top_k\": 50,   \"repetition_penalty\": 1.0 }'<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0418\u0418 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u2014 \u0445\u043e\u0442\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0442\u0440\u0443\u0434\u043e\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u043b\u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 (\u044d\u0442\u043e \u043d\u0435 \u0448\u0443\u0442\u043a\u0430):<\/p>\n<pre><code class=\"json\">{    \"id\": \"chatcmpl-1745243015.727946\",    \"object\": \"chat.completion\",    \"created\": 1745243015,    \"model\": \"Gemma-3-12b\",    \"choices\": [        {            \"index\": 0,            \"message\": {                \"role\": \"assistant\",                \"content\": \"\u0412 \u043c\u0430\u0440\u0442\u0435 2025 \u0433\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 **\u0447\u0435\u0442\u044b\u0440\u0435** \u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430.\\n\\n\u0412\u043e\u0442 \u0434\u0430\u0442\u044b:\\n\\n*   6 \u043c\u0430\u0440\u0442\u0430\\n*   13 \u043c\u0430\u0440\u0442\u0430\\n*   20 \u043c\u0430\u0440\u0442\u0430\\n*   27 \u043c\u0430\u0440\u0442\u0430\"            },            \"finish_reason\": \"stop\"        }    ],    \"usage\": {        \"prompt_tokens\": 23,        \"completion_tokens\": 46,        \"total_tokens\": 69    } }<\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/89e\/27c\/144\/89e27c144855bacb1a3d88d0058d1b13.png\" alt=\"\u0412\u043e\u0442 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u044c Qwen3-14B, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u043b\u0430 48 \u0441\u0435\u043a., \u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0430\u0441\u044c\" title=\"\u0412\u043e\u0442 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u044c Qwen3-14B, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u043b\u0430 48 \u0441\u0435\u043a., \u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0430\u0441\u044c\" width=\"2492\" height=\"1184\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/89e\/27c\/144\/89e27c144855bacb1a3d88d0058d1b13.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/89e\/27c\/144\/89e27c144855bacb1a3d88d0058d1b13.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u043e\u0442 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u044c Qwen3-14B, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u043b\u0430 48 \u0441\u0435\u043a., \u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u043f\u0440\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0430\u0441\u044c<\/figcaption><\/div>\n<\/figure>\n<h4>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0432 Ray Dashboard<\/h4>\n<p>\u0412 Ray Dashboard \u0432\u0438\u0434\u0438\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c GPU: \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c ~40 token\/s \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9bf\/489\/011\/9bf489011c0d4cc8f08d91617e373960.png\" alt=\"\u0427\u0435\u0441\u0442\u043d\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u0441\u043a\u0440\u0438\u043d \u043b\u043e\u0433\u043e\u0432 \u0432\u0437\u044f\u0442 \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Ray \u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 Dolphin, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Engine V0. \u0412\u00a0\u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 V1 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043b\u043e\u0433\u043e\u0432 \u043f\u043e\u00a0\u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0443 \/metrics, \u043d\u043e\u00a0\u044f \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\" title=\"\u0427\u0435\u0441\u0442\u043d\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u0441\u043a\u0440\u0438\u043d \u043b\u043e\u0433\u043e\u0432 \u0432\u0437\u044f\u0442 \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Ray \u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 Dolphin, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Engine V0. \u0412\u00a0\u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 V1 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043b\u043e\u0433\u043e\u0432 \u043f\u043e\u00a0\u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0443 \/metrics, \u043d\u043e\u00a0\u044f \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\" width=\"1600\" height=\"902\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/9bf\/489\/011\/9bf489011c0d4cc8f08d91617e373960.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9bf\/489\/011\/9bf489011c0d4cc8f08d91617e373960.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0427\u0435\u0441\u0442\u043d\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u0441\u043a\u0440\u0438\u043d \u043b\u043e\u0433\u043e\u0432 \u0432\u0437\u044f\u0442 \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Ray \u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 Dolphin, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Engine V0. \u0412\u00a0\u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 V1 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043b\u043e\u0433\u043e\u0432 \u043f\u043e\u00a0\u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0443 \/metrics, \u043d\u043e\u00a0\u044f \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6a8\/28f\/7cc\/6a828f7cc639cba292b510fe1b335f8f.png\" alt=\"\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0430\u043c Ray Cluster \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b\" title=\"\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0430\u043c Ray Cluster \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b\" width=\"1600\" height=\"795\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/6a8\/28f\/7cc\/6a828f7cc639cba292b510fe1b335f8f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6a8\/28f\/7cc\/6a828f7cc639cba292b510fe1b335f8f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0430\u043c Ray Cluster \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u043b\u043e\u0433\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430, \u043c\u043e\u0436\u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043b\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a7\/ed3\/21e\/3a7ed321edb2a408dd55aef191c9e25f.png\" width=\"1600\" height=\"886\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3a7\/ed3\/21e\/3a7ed321edb2a408dd55aef191c9e25f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a7\/ed3\/21e\/3a7ed321edb2a408dd55aef191c9e25f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c, \u044f \u043f\u0440\u043e\u0432\u0451\u043b \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/ray-project\/llmperf\">LLMPerf<\/a> \u2014 \u043e\u0434\u0438\u043d \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439. <\/p>\n<h4>\u041a\u0430\u043a \u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b<\/h4>\n<p>\u0422\u0435\u0441\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 <code>token_benchmark_ray.py<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u043d\u044f\u043b \u0447\u0438\u0441\u043b\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (1, 4, 8, 16, 20), \u0434\u043b\u0438\u043d\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (\u043e\u0442 512 \u0434\u043e 32 768 \u0442\u043e\u043a\u0435\u043d\u043e\u0432) \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u044d\u043c\u043f\u043b\u0438\u043d\u0433\u0430 (greedy, Top-K, Top-P, \u0438\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043e\u0442 30 \u0434\u043e 100 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b:<\/p>\n<ul>\n<li>\n<p>\u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0442\u043e\u043a\u0435\u043d (<code>inter_token_latency_s<\/code>);<\/p>\n<\/li>\n<li>\n<p>\u0432\u0440\u0435\u043c\u044f \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 (<code>ttft_s<\/code>);<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u0449\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 (<code>end_to_end_latency_s<\/code>);<\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c (<code>throughput_token_per_s<\/code>);<\/p>\n<\/li>\n<li>\n<p>p50\/p95\/p99 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u0441\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 <code>llm_correctness.py<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0434\u043e 300 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438 20 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0441\u0441\u0438\u044f\u0445 \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u043b, \u0441\u0442\u0430\u043b\u0438 \u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u00ab\u0443\u0435\u0437\u0436\u0430\u0442\u044c\u00bb \u043e\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u043b\u0438 \u0443\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043e\u0448\u0438\u0431\u043a\u0443. \u0424\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b <code>error_rate<\/code> \u0438 <code>mismatch_rate<\/code>.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h4>\n<ul>\n<li>\n<p><strong>CUDA Graph<\/strong> \u0434\u043b\u044f Gemma-3-12B \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c (<code>ENABLE_ENFORCE_EAGER=true<\/code>), \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u0434\u0430\u043b\u0430. \u041d\u0430 Dolphin3.0 \u0441 \u0433\u0440\u0430\u0444\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u043b\u0430 \u2248 40 t\/s.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438, \u043a\u0430\u043a \u0432\u0435\u0440\u043d\u0443\u0442\u044c CUDA Graph \u0434\u043b\u044f Gemma-3 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<\/blockquote>\n<ul>\n<li>\n<p>\u0422\u0435\u0441\u0442\u044b \u0448\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 OpenAI API, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0441\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043e\u0432\u0435\u0440\u0445\u0435\u0434.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c\u0438 GPU \u0438 RAM, \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<ul>\n<li>\n<p><strong>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong>: \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u043a\u0430\u0436\u0434\u044b\u0435 \u2248 0,116 \u0441, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u2248 10 tok\/s, \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u2248 3,2 \u0441.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c<\/strong>: \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e 8 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u2014 \u043f\u0440\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0440\u043e\u0441\u0442\u0435 latency \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 \u043d\u0435\u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/strong>: \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0435\u043b \u2014 \u0434\u043e \u2248 2\u2009000\u20134\u2009000 \u0442\u043e\u043a\u0435\u043d\u043e\u0432; \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u043a\u043d\u0430\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0430\u0434\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c (\u0434\u043e 6 tok\/s \u043d\u0430 8\u2009192 \u0442\u043e\u043a\u0435\u043d\u0430\u0445 \u0438 \u043d\u0438\u0436\u0435) \u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u0440\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u044d\u043c\u043f\u043b\u0438\u043d\u0433<\/strong>: \u0432\u044b\u0431\u043e\u0440 Top-K \u0438\u043b\u0438 Top-P \u0434\u0430\u0451\u0442 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 (&lt; 0,005 \u0441\/\u0442\u043e\u043a\u0435\u043d), \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c<\/strong>: \u043f\u0440\u0438 20 concurrent \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 error_rate = 0 %, mismatch_rate &lt; 1 % \u2014 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e, \u0431\u0435\u0437 \u043f\u0430\u0434\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/tree\/main\/llmperf_test_results\">\u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<h3>\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0438\u0442\u043e\u0433\u0438<\/h3>\n<ol>\n<li>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 Gemma 3 \u0438\u0437 Hugging Face, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0432 \u0435\u0451 \u0432 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0441 vLLM \u00ab\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c\u00bb.<\/p>\n<\/li>\n<li>\n<p>API <code>\/v1\/chat\/completions<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u2014 \u043e\u043d \u0432\u044b\u0434\u0430\u0451\u0442 JSON-\u043e\u0442\u0432\u0435\u0442, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 OpenAI-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u043e\u043c\u0443 \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0443, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 Secret.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u043b\u0438 \u0440\u044f\u0434 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e LLMPerf. \u0421\u0440\u0435\u0434\u043d\u044f\u044f \u043c\u0435\u0436\u0442\u043e\u043a\u0435\u043d\u043e\u0432\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u22480,116 \u0441, \u0430 throughput \u2014 \u224810 \u0442\/\u0441, \u0447\u0442\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430. \u041d\u0435\u00a0\u0442\u0430\u043a\u00a0\u0431\u044b\u0441\u0442\u0440\u043e, \u043a\u0430\u043a\u00a0\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c\u00a0\u0431\u044b, \u043d\u043e\u00a0\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<\/li>\n<\/ol>\n<h3>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 API. \u0414\u0430\u043b\u044c\u0448\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439, \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439, \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c OpenWebUI \u2014 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 LLM. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u0432\u044f\u0437\u0430\u0442\u044c OpenWebUI \u0441 \u043d\u0430\u0448\u0438\u043c Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0447\u0435\u0440\u0435\u0437 OpenAI-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 API.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/906702\/\"> https:\/\/habr.com\/ru\/articles\/906702\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e vLLM \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043c\u0443 \u0447\u0435\u0440\u0435\u0437 Ray Serve. \u0410 \u0435\u0449\u0451 \u0432\u044b\u044f\u0441\u043d\u0438\u043c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c Gemma 3 \u0432 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0438 \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e OpenAI-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0430 \u0441 JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439. <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0441\u0442\u043e\u0438\u0442 <a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/906700\/\">\u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043d\u0435\u0451<\/a>. \u0422\u0430\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u00ab\u0436\u0435\u043b\u0435\u0437\u043e\u00bb \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0441 Ray Serve \u0438 vLLM.<\/p>\n<p><a class=\"anchor\" name=\"vllm\" id=\"vllm\"><\/a><\/p>\n<h3>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 vLLM \u0434\u043b\u044f \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 Ray Serve \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 API<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b API.<\/p>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 vLLM \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0432\u044b\u0431\u0440\u0430\u043d<\/h4>\n<p><a href=\"https:\/\/github.com\/vllm-project\/vllm\">vLLM<\/a> \u2014 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p><strong>\u041d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong> (tensor parallel): \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u0442\u0435\u043d\u0437\u043e\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0435\u0436\u0434\u0443 GPU \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0439\u043f\u043b\u0430\u0439\u043d-\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c<\/strong> (pipeline parallel): \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438-\u0441\u043b\u043e\u0438 \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0445 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u043d\u043e\u0434\u0430\u043c: \u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u043b\u043e\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 GPU \u043d\u043e\u0434\u044b \u0410, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u2014 \u043d\u0430 GPU \u043d\u043e\u0434\u044b B \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u043d\u043e\u0434\u0430 \u0410 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u043e\u0434\u0430 B \u0443\u0436\u0435 \u0434\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u2014 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 NVIDIA Collective Communications Library<\/strong> (NCCL), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u0435\u0440\u0445\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043e\u0431\u043c\u0435\u043d \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 GPU \u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u043e\u0434\u0430\u043c\u0438 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e RDMA\/InfiniBand), \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u044f \u0432\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043b.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b<\/strong>: \u043e\u0442\u0434\u0430\u0451\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u043c\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u0430\u043a \u0432 OpenAI ChatCompletion API, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u044d\u0442\u043e \u0434\u0430\u0451\u0442 \u043d\u0430\u043c:<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u0443\u044e \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u044c: \u0432\u0441\u0435 VRAM-\u043a\u0430\u0440\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435, \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044f \u0441\u0432\u043e\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443: \u0442\u0435\u043d\u0437\u043e\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u0440\u0442\u0435 \u0438\u0434\u0443\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u044e\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb: \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, 1 \u0438\u043b\u0438 8 GPU \u043d\u0430 \u043d\u043e\u0434\u0435 \u0438 \u043a\u0430\u043a\u043e\u0432\u043e \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0434, vLLM + NCCL \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043b\u044e\u0431\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u0445 \u043a\u0430\u0440\u0442.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 vLLM \u0437\u0430\u0434\u0430\u0451\u043c:<\/p>\n<ol>\n<li>\n<p><strong>Tensor parallel size<\/strong> \u2014 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u00ab\u043a\u0443\u0441\u043e\u0447\u043a\u043e\u0432\u00bb \u0432\u0435\u0441\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e GPU \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0437\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>Pipeline parallel size<\/strong> \u2014 \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0434\u0438\u0439 \u0434\u0440\u043e\u0431\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e \u043d\u043e\u0434\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p><strong>gpu_memory_utilization<\/strong> \u0438 <strong>cpu_offload_gb<\/strong> \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u044a\u0451\u043c\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u043e\u0441\u0442\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a \u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440.<\/p>\n<p><a class=\"anchor\" name=\"rayserve\" id=\"rayserve\"><\/a><\/p>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Ray Serve<\/h4>\n<p><a href=\"https:\/\/docs.ray.io\/en\/latest\/serve\/index.html\">Ray Serve<\/a> \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Ray, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c FastAPI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u2014 \u043a\u0430\u0436\u0434\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0443\u0437\u043b\u0435, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 GPU, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Ray Serve, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 HTTP API, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 OpenAI-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430\u043c\u0438 (ChatCompletion). \u0427\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 API \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0441\u043c\u043e\u0433\u0443\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043c\u043e\u0434\u0435\u043b\u0438, \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u043e\u0439 \u0432 vLLM.<\/p>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u0435<\/h4>\n<ol>\n<li>\n<p><strong>\u0412\u043d\u0443\u0442\u0440\u0438 \u0443\u0437\u043b\u0430. <\/strong>Tensor Parallelism \u0434\u0440\u043e\u0431\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043a\u0443\u0441\u043a\u0438, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u0445 \u043d\u0430 \u0432\u0441\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 GPU \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NCCL \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u00ad\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438. <\/strong>Pipeline Parallelism \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0441 GPU \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440: \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u00ab\u0441\u0442\u0430\u0434\u0438\u044e\u00bb \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0442\u0430\u043a \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0435\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. <\/strong>Ray Serve \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u044e \u044d\u0442\u0443 \u043c\u043e\u0449\u044c \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 HTTP-\u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e OpenAI-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443. \u041e\u043d \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0435 \u0448\u0430\u0440\u0434-\u0433\u0440\u0443\u043f\u043f\u044b, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 GPU \u0438 \u043d\u043e\u0434\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/h4>\n<blockquote>\n<p>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: \u044f \u043d\u0435 Python-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 production-ready \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<\/blockquote>\n<p><strong>\u0421\u043a\u0440\u0438\u043f\u0442 serve.py<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/serve.py\">serve.py<\/a>. \u0412 \u043d\u0451\u043c:<\/p>\n<ul>\n<li>\n<p>\u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f vLLM \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 (tensor parallel, pipeline parallel \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435);<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f FastAPI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f ChatCompletion \u2014 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u043e\u0433\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<\/li>\n<li>\n<p>Ray Serve \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0421\u043a\u0440\u0438\u043f\u0442 auth.py<\/strong><\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/auth.py\">auth.py<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 JWT \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0440\u0451\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u043b\u043e\u0433\u0438\u043d, \u0440\u043e\u043b\u044c, \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f) \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, USER_LIST);<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u043e\u043b\u0438 (admin\/user) \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0436\u0438\u0437\u043d\u0438 \u0442\u043e\u043a\u0435\u043d\u0430.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 <code>serve.py<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u044d\u043d\u0434\u043f\u043e\u0439\u043d\u0442\u0430\u043c. \u0415\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0430 (\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u043e\u0432, \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0438 \u0440\u043e\u043b\u0435\u0439) \u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c.<\/p>\n<\/blockquote>\n<h3>\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0438\u0442\u043e\u0433\u0438\u00a0<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p><code>serve.py<\/code>\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0433\u0434\u0435 Ray Serve \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 FastAPI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 vLLM \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c;<\/p>\n<\/li>\n<li>\n<p><code>auth.py<\/code>\u00a0\u2014 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 JWT-\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u0438\u043c \u0434\u0432\u0443\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441, \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0438\u043c\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 Docker-\u043e\u0431\u0440\u0430\u0437 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0451 \u0432 KubeRay.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 KubeRay<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c Docker-\u043e\u0431\u0440\u0430\u0437, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 Registry \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c Ray Cluster \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CephFS \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c CPU- \u0438 GPU-\u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u044f \u0431\u0435\u0440\u0443 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Docker-\u043e\u0431\u0440\u0430\u0437 Ray, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437.<\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 Docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 Registry<\/h4>\n<p><strong>1. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Ray:\u00a0<\/strong><\/p>\n<ul>\n<li>\n<p>\u0411\u0435\u0440\u0451\u043c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Ray \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>rayproject\/ray:2.44.0-py310-cu124<\/code>. \u041e\u043d \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Ray, CUDA-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 Python 3.10.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043f\u0430\u043a\u0435\u0442\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c <code>serve.py<\/code>, <code>auth.py<\/code> (\u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044f \u0432\u0441\u0451 \u0432 zip-\u0430\u0440\u0445\u0438\u0432).<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>vLLM<\/code>, <code>httpx<\/code>, <code>PyJWT<\/code> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<p><strong>3. \u0421\u0431\u043e\u0440\u043a\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0438\u0448\u0435\u043c Dockerfile (<a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/dockerfile.ray\">dockerfile.ray<\/a>), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 zip-\u0444\u0430\u0439\u043b\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 pip-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Make (<a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/ray-serve-vllm\/Makefile\">Makefile<\/a>) \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">make package-container<\/code><\/pre>\n<p><strong>4. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0443\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 Registry \u2014 DockerHub, GitLab Registry \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">docker push gitlab.example.com:5050\/it-operations\/k8s-config\/vllm-0.8.4-ray-2.44.0-py310-cu124-serve:1.1.7<\/code><\/pre>\n<ul>\n<li>\n<p>\u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e Kubernetes-\u0443\u0437\u043b\u044b \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u043e\u043c\u0443 Registry. \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 Deckhouse <a href=\"https:\/\/deckhouse.ru\/products\/kubernetes-platform\/documentation\/v1\/modules\/node-manager\/faq.html#%D0%BA%D0%B0%D0%BA-%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C-%D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8E-%D0%B2-%D0%B4%D0%BE%D0%BF%D0%BE%D0%BB%D0%BD%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9-registry\">\u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/a> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 registry, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043d\u0435\u0433\u043e.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 KubeRay Cluster<\/h4>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c Ray Cluster \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Helm-\u0447\u0430\u0440\u0442\u0430 \u0438 values-\u0444\u0430\u0439\u043b\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0442\u0430\u043a\u0430\u044f:<\/p>\n<ul>\n<li>\n<p><strong>head<\/strong> (\u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0443\u0437\u0435\u043b)\u00a0\u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 Ray Head Pod \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c Ray Dashboard, Autoscaler, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0443\u0436\u0435\u043d, \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 worker&#8217;\u0430\u043c\u0438. \u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0436\u0438\u043c\u0430 HA \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.ray.io\/en\/latest\/cluster\/kubernetes\/user-guides\/kuberay-gcs-ft.html#gcs-fault-tolerance-in-kuberay\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f<\/a> <code>gcsFaultToleranceOptions<\/code> \u2014 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>worker<\/strong>\u00a0\u2014 1+ \u043f\u043e\u0434\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 CPU \u0438\u043b\u0438 GPU.<\/p>\n<\/li>\n<li>\n<p><strong>additionalWorkerGroups<\/strong>\u00a0\u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0433\u0440\u0443\u043f\u043f\u044b worker&#8217;\u043e\u0432 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0430\u0431\u044b\u0439 GPU).<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/Myskat90\/vllm-habr\/blob\/main\/argo-projects\/kube-ray\/charts\/ray-cluster\/ap-values.yaml\">ap-values.yaml<\/a> \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438.<\/p>\n<p><strong>1. image<\/strong><\/p>\n<pre><code class=\"yaml\">image:   repository: gitlab.example.com:5050\/it-operations\/k8s-config\/vllm-0.8.4-ray-2.44.0-py310-cu124-serve   tag: 1.1.7   pullPolicy: IfNotPresent<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><code>repository<\/code> \u0438 <code>tag<\/code> \u2014 \u044d\u0442\u043e Docker-\u043e\u0431\u0440\u0430\u0437, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435;<\/p>\n<\/li>\n<li>\n<p><code>pullPolicy: IfNotPresent<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e Kubernetes \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u043e\u0432\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437, \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. imagePullSecrets<\/strong><\/p>\n<pre><code class=\"yaml\">imagePullSecrets:   - name: regcred<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 Registry \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442 (credential).<\/p>\n<p><strong>3. common<\/strong><\/p>\n<pre><code class=\"yaml\">common:   containerEnv:     - name: HF_HOME       value: \"\/data\/model-cache\"     - name: DTYPE       value: \"bfloat16\"     - name: GPU_MEMORY_UTIL       value: \"0.98\"     - name: MAX_MODEL_LEN       value: \"131072\"<\/code><\/pre>\n<p><code>containerEnv<\/code> \u0437\u0430\u0434\u0430\u0451\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0438 \u0432 head, \u0438 \u0432 worker:<\/p>\n<ul>\n<li>\n<p><code>DTYPE<\/code> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, float16) \u2014 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0435;<\/p>\n<\/li>\n<li>\n<p><code>GPU_MEMORY_UTIL<\/code> \u2014 \u0434\u043e\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 vLLM;<\/p>\n<\/li>\n<li>\n<p><code>MAX_MODEL_LEN<\/code> \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 (\u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438).<\/p>\n<\/li>\n<\/ul>\n<p><strong>4. head<\/strong><\/p>\n<pre><code class=\"yaml\">head:   rayVersion: \"2.44.0\"   enableGcsFT: true     gcsFT:     # externalStorageNamespace: ray-gcs-backup       redisAddress: redis:6379                             redisSecret:         name: redis-password-secret         key: password   labels:     component: ray-head   serviceAccountName: \"sa-deepseek-cluster\"   rayStartParams:     dashboard-host: \"0.0.0.0\"     num-cpus: \"0\"     metrics-export-port: \"8080\"   containerEnv:     - name: RAY_PROMETHEUS_HOST       value: https:\/\/prometheus.d8-monitoring:9090   envFrom:     - secretRef:         name: auth-config   resources:     limits:       cpu: \"6\"       memory: \"8G\"     requests:       cpu: \"3\"       memory: \"4G\"   volumes:     - name: model-cache       persistentVolumeClaim:         claimName: model-cache-pvc   volumeMounts:     - mountPath: \/data\/model-cache       name: model-cache<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><code>rayVersion<\/code> \u2014 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Ray \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Autoscaler&#8217;\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d in-tree Autoscaling;<\/p>\n<\/li>\n<li>\n<p><code>serviceAccountName<\/code> \u2014 ServiceAccount, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043f\u043e\u0434\u0443. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a PV, Secret \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p><code>envFrom<\/code> \u2014 \u0431\u0435\u0440\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 Secret auth-config. \u042d\u0442\u043e \u043b\u043e\u0433\u0438\u043d\u044b, \u043f\u0430\u0440\u043e\u043b\u0438, JWT-\u043a\u043b\u044e\u0447\u0438;<\/p>\n<\/li>\n<li>\n<p><code>resources<\/code> \u2014 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043b\u0438\u043c\u0438\u0442\u044b CPU\/RAM \u0434\u043b\u044f head-\u043f\u043e\u0434\u0430. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435: \u043b\u0438\u043c\u0438\u0442 6\u00a0CPU, 8GiB\u00a0RAM;<\/p>\n<\/li>\n<li>\n<p><code>volumes<\/code><strong> <\/strong>\/ <code>volumeMounts<\/code> \u2014 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 CephFS (\u0447\u0435\u0440\u0435\u0437 PVC model-cache-pvc) \u043d\u0430 \u043f\u0443\u0442\u044c <code>\/data\/model-cache<\/code>, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f head.<\/p>\n<\/li>\n<\/ul>\n<p><strong>HA-\u0440\u0435\u0436\u0438\u043c GCS (GCS Fault Tolerance)<\/strong><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 Ray-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043e\u0442\u043a\u0430\u0437\u0430 (GCS Head), \u043c\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 Redis:<\/p>\n<ul>\n<li>\n<p><code>enableGcsFT: true<\/code> \u2014 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-459543","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459543","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=459543"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459543\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=459543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=459543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=459543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}