@aiuby-ia/cli 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/aiuby.mjs
CHANGED
|
@@ -20485,6 +20485,7 @@ var noControl = (v) => !CONTROL_CHARS.test(v);
|
|
|
20485
20485
|
var ENV_NAME = /^[A-Z_][A-Z0-9_]{0,63}$/;
|
|
20486
20486
|
var RESERVED_ENV = /* @__PURE__ */ new Set(["PORT", "K_SERVICE", "K_REVISION", "K_CONFIGURATION"]);
|
|
20487
20487
|
var MAX_ENV_VARS = 50;
|
|
20488
|
+
var MAX_ARGS = 30;
|
|
20488
20489
|
var IMAGE_REF = /^(?!.*\/\/)[A-Za-z0-9][A-Za-z0-9._\-/:@]*$/;
|
|
20489
20490
|
var HardwareRequest = external_exports.object({
|
|
20490
20491
|
/** `any`: o planejador escolhe entre os provedores habilitados. */
|
|
@@ -20499,6 +20500,8 @@ var AppConfig = external_exports.object({
|
|
|
20499
20500
|
runtime: external_exports.enum(["container", "python"]),
|
|
20500
20501
|
image: external_exports.string().min(1).max(300).regex(IMAGE_REF, "image precisa ser uma refer\xEAncia de imagem de container, sem espa\xE7os").nullable().default(null),
|
|
20501
20502
|
entrypoint: external_exports.string().min(1).max(300).refine(noControl, "entrypoint n\xE3o aceita caracteres de controle").nullable().default(null),
|
|
20503
|
+
/** Argumentos do processo da imagem (substituem o `CMD`). Vazio: vale o que a imagem define. */
|
|
20504
|
+
args: external_exports.array(external_exports.string().min(1).max(300).refine(noControl, "args n\xE3o aceita caracteres de controle")).max(MAX_ARGS, `no m\xE1ximo ${MAX_ARGS} argumentos`).default([]),
|
|
20502
20505
|
port: external_exports.number().int().min(1).max(65535).default(8080),
|
|
20503
20506
|
/**
|
|
20504
20507
|
* Variáveis de ambiente da aplicação. Ficam na configuração, visíveis a quem vê a
|
|
@@ -20634,7 +20637,7 @@ async function appsStatus(io, args) {
|
|
|
20634
20637
|
});
|
|
20635
20638
|
}
|
|
20636
20639
|
var brl = (microBrl) => (microBrl / 1e6).toLocaleString("pt-BR", { style: "currency", currency: "BRL" });
|
|
20637
|
-
var paidLine = (paid) => `Tamanho ${paid.sizeName}${paid.priceMicroBrlPerHour !== null ? `: ${brl(paid.priceMicroBrlPerHour)} por hora em uso` : ""}.`;
|
|
20640
|
+
var paidLine = (paid) => `Tamanho ${paid.sizeName}${paid.priceMicroBrlPerHour !== null ? `: ${brl(paid.priceMicroBrlPerHour)} ${paid.unit === "hour_started" ? "por hora iniciada de inst\xE2ncia ligada" : "por hora em uso"}` : ""}.`;
|
|
20638
20641
|
var fetchDeployment = (io, stored, slug) => apiGet(stored, `/api/platform/compute/apps/${encodeURIComponent(slug)}/deployments`, io.fetcher);
|
|
20639
20642
|
var when = (iso) => new Date(iso).toLocaleString("pt-BR", { dateStyle: "short", timeStyle: "short" });
|
|
20640
20643
|
function printDeployment(io, d) {
|
|
@@ -20704,7 +20707,7 @@ async function billing(io) {
|
|
|
20704
20707
|
io.out(`Compute no m\xEAs: ${brl(data.monthSpendMicroBrl)}`);
|
|
20705
20708
|
io.out(`Teto do workspace: ${data.budgetMicroBrl === null ? "n\xE3o definido (dono ou admin define na tela do Compute)" : brl(data.budgetMicroBrl)}`);
|
|
20706
20709
|
io.out("");
|
|
20707
|
-
table(io, ["TAMANHO", "VCPU", "MEM\xD3RIA", "PRE\xC7O
|
|
20710
|
+
table(io, ["TAMANHO", "VCPU", "MEM\xD3RIA", "REGI\xC3O", "PRE\xC7O"], data.sizes.map((s) => [s.name, String(s.cpu), `${s.memoryMb} MB`, s.region ?? "S\xE3o Paulo", s.priceMicroBrlPerHour === null ? "-" : `${brl(s.priceMicroBrlPerHour)} ${s.unit === "hour_started" ? "por hora iniciada" : "por hora em uso"}`]));
|
|
20708
20711
|
});
|
|
20709
20712
|
}
|
|
20710
20713
|
async function usage(io, args) {
|
|
@@ -20771,7 +20774,9 @@ async function appsUpdate(io, args) {
|
|
|
20771
20774
|
const app = readAppFile(io, file2);
|
|
20772
20775
|
const stored = requireLogin();
|
|
20773
20776
|
const current = await apiGet(stored, `/api/platform/compute/apps/${encodeURIComponent(app.slug)}`, io.fetcher);
|
|
20774
|
-
const
|
|
20777
|
+
const stored_ = current.revisions.find((r) => r.revision === current.currentRevision)?.config;
|
|
20778
|
+
const normalized = stored_ ? AppConfig.safeParse(stored_) : null;
|
|
20779
|
+
const latest = normalized?.success ? normalized.data : stored_;
|
|
20775
20780
|
if (latest && JSON.stringify(sortKeys(latest)) === JSON.stringify(sortKeys(app.config))) {
|
|
20776
20781
|
emit(io, { id: current.id, slug: current.slug, revision: current.currentRevision, changed: false }, () => io.out(`Sem mudan\xE7a: ${current.slug} j\xE1 est\xE1 com essa configura\xE7\xE3o (r${current.currentRevision}).`));
|
|
20777
20782
|
return;
|
|
@@ -20836,7 +20841,7 @@ var notYet = (command) => async () => {
|
|
|
20836
20841
|
};
|
|
20837
20842
|
|
|
20838
20843
|
// src/main.ts
|
|
20839
|
-
var VERSION = "0.5.
|
|
20844
|
+
var VERSION = "0.5.2";
|
|
20840
20845
|
var HELP = `aiuby ${VERSION} \u2014 linha de comando do AIUBY Compute
|
|
20841
20846
|
|
|
20842
20847
|
Uso: aiuby <comando> [op\xE7\xF5es]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geração de imagem com um modelo de difusão do Hugging Face. O modelo é baixado na primeira
|
|
2
2
|
# subida: escolha um cuja licença permita o seu uso e que caiba na memória da GPU pedida.
|
|
3
|
-
FROM pytorch/pytorch:2.
|
|
3
|
+
FROM pytorch/pytorch:2.7.1-cuda12.6-cudnn9-runtime
|
|
4
4
|
WORKDIR /app
|
|
5
5
|
COPY requirements.txt .
|
|
6
6
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Opcional: o aiuby.toml já usa a imagem oficial do vLLM com o modelo nos argumentos. Use este
|
|
2
|
+
# Dockerfile só se quiser uma imagem própria (por exemplo, com o modelo fixo). O modelo é baixado na subida:
|
|
2
3
|
# escolha um que caiba na memória da GPU pedida e cuja licença permita o seu uso.
|
|
3
4
|
FROM vllm/vllm-openai:latest
|
|
4
|
-
ENV MODEL_ID="
|
|
5
|
+
ENV MODEL_ID="microsoft/Phi-3-mini-4k-instruct" HF_HOME="/tmp/hf"
|
|
5
6
|
EXPOSE 8080
|
|
6
7
|
ENTRYPOINT ["/bin/sh", "-c", "python3 -m vllm.entrypoints.openai.api_server --model \"$MODEL_ID\" --host 0.0.0.0 --port 8080"]
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
# Inferência compatível com OpenAI em GPU
|
|
1
|
+
# Inferência compatível com OpenAI em GPU, com a imagem oficial do vLLM e o Phi-3 mini.
|
|
2
|
+
# Não precisa construir imagem: os argumentos escolhem o modelo. Valide com: aiuby config validate
|
|
2
3
|
name = "Inferência vLLM"
|
|
3
4
|
slug = "inferencia-vllm"
|
|
4
5
|
|
|
5
6
|
[config]
|
|
6
7
|
runtime = "container"
|
|
7
|
-
image = "
|
|
8
|
+
image = "docker.io/vllm/vllm-openai:latest"
|
|
9
|
+
args = ["--model", "microsoft/Phi-3-mini-4k-instruct", "--host", "0.0.0.0", "--port", "8080", "--max-model-len", "4096"]
|
|
8
10
|
port = 8080
|
|
9
11
|
|
|
12
|
+
[config.env]
|
|
13
|
+
HF_HOME = "/tmp/hf"
|
|
14
|
+
|
|
10
15
|
[config.hardware]
|
|
11
16
|
provider = "gcp"
|
|
12
17
|
cpu = 4
|