ensure_api_key() { if "${GCLOUD}" secrets describe "${SECRET_NAME}" --project "${PROJECT}" >/dev/null 2>&1; then log "Secret exists: ${SECRET_NAME}" if "${GCLOUD}" secrets versions list "${SECRET_NAME}" --project "${PROJECT}" 2>/dev/null | grep -q "^[0-9]"; then log "Re-using existing API key version (retrieve with ./scripts/invoke_helios_preview.sh key)." return 0 fi else log "Creating secret: ${SECRET_NAME}" "${GCLOUD}" secrets create "${SECRET_NAME}" \ --project "${PROJECT}" \ --replication-policy=automatic >/dev/null fi local key key="$(python3 -c 'import secrets; print("hlp_" + secrets.token_urlsafe(32))')" printf '%s' "${key}" | "${GCLOUD}" secrets versions add "${SECRET_NAME}" \ --project "${PROJECT}" \ --data-file=- >/dev/null log "New API key generated. SAVE NOW (won't be shown again): ${key}" } from __future__ import annotations ## Cloudflare fallback def _inject(body: bytes) -> bytes: if not INJECT or not body: return body try: data = json.loads(body) except Exception: return body # Enable prompt cache (KV cache reuse) data["cache_prompt"] = True msgs = data.get("messages") if not isinstance(msgs, list) or not msgs: return body ## Dataset Layers PROJECT="${PROJECT:-project-6168b668-98c9-444b-b27}" REGION="${REGION:-europe-west1}" SECRET_NAME="helios-preview-api-key" SERVICE="helios-preview" MODEL="maximo-helios-preview" GCLOUD="${GCLOUD:-/Users/johnsondaniel/google-cloud-sdk/bin/gcloud}" print_summary() { local api_url api_url="$("${GCLOUD}" run services describe "${API_SERVICE}" --project "${PROJECT}" --region "${REGION}" --format='value(status.url)')" echo echo "============================================================" echo " maximo helios nano preview — DEPLOYED" echo "============================================================" echo " Endpoint URL : ${api_url}" echo " Served model : maximo-helios-nano-preview" echo " Region : ${REGION}" echo " GPU : 1x nvidia-l4 (scales to zero when idle)" echo " Auth : Authorization: Bearer " echo " Secret name : ${SECRET_NAME} (in Secret Manager)" echo echo " Example:" echo " curl ${api_url}/v1/models \\" echo " -H 'Authorization: Bearer '" echo echo " OpenAI-compatible SDK:" echo " from openai import OpenAI" echo " client = OpenAI(base_url='${api_url}/v1', api_key='')" echo " r = client.chat.completions.create(" echo " model='maximo-helios-nano-preview'," echo " messages=[{'role':'user','content':'Solve 2x+3=11'}]" echo " )" echo "============================================================" } ```text gs://maximoai-models-976606885534/ raw/ public/ private/ maximo-screen-records/ mytabulon-ui-screenshots/ processed/ pretrain/ sft/ eval/ manifests/ snapshots/ runs/ ``` api_url="$(url)" api_key="$(key)" ```bash ./scripts/invoke_helios_preview.sh key # show API key ./scripts/invoke_helios_preview.sh chat "Write a haiku" # chat ./scripts/invoke_helios_preview.sh tools "Weather in Lagos?" # tool calling ``` { "bucket": "gs://maximoai-models-976606885534", "config": "/Users/johnsondaniel/Documents/maximoai-models/configs/public_dataset_ingest.json", "datasets": [ { "bytes_uploaded": 37156608, "category": "tool_calling", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/toolace/6bda777c88d2/README.md", "path": "README.md", "size": 1873, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/toolace/6bda777c88d2/data.json", "path": "data.json", "size": 37154735, "status": "uploaded" } ], "id": "Team-ACE/ToolACE", "license": "apache-2.0", "purpose": "General function/tool-calling SFT.", "revision": "6bda777c88d21e5a204703c1ee45597a8fa4f734", "slug": "toolace" }, { "bytes_uploaded": 66774246, "category": "tool_calling", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/README.md", "path": "README.md", "size": 37741, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/func-calling-singleturn.json", "path": "func-calling-singleturn.json", "size": 17793686, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/func-calling.json", "path": "func-calling.json", "size": 20554130, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/glaive-function-calling-5k.json", "path": "glaive-function-calling-5k.json", "size": 20416419, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/json-mode-agentic.json", "path": "json-mode-agentic.json", "size": 5019263, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/json-mode-singleturn.json", "path": "json-mode-singleturn.json", "size": 2953007, "status": "uploaded" } ], "id": "NousResearch/hermes-function-calling-v1", "license": "apache-2.0", "purpose": "Function-calling examples with tool schemas and ShareGPT-style traces.", "revision": "dae3e1d28cfbcf4b915c04ea1e072030529b4bda", "slug": "hermes-function-calling-v1" }, { "bytes_uploaded": 271190171, "category": "tool_calling", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/glaive-function-calling-v2/e7f4b6456019/README.md", "path": "README.md", "size": 106, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/glaive-function-calling-v2/e7f4b6456019/glaive-function-calling-v2.json", "path": "glaive-function-calling-v2.json", "size": 271190065, "status": "uploaded" } ], "id": "glaiveai/glaive-function-calling-v2", "license": "apache-2.0", "purpose": "Large function-calling SFT set with mixed tool and no-tool examples.", "revision": "e7f4b6456019f5d8bcb991ef0dd67d8ff23221ac", "slug": "glaive-function-calling-v2" }, { "bytes_uploaded": 11717747, "category": "tool_calling_eval", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_chatable.json", "path": "BFCL_v3_chatable.json", "size": 24980, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_exec_multiple.json", "path": "BFCL_v3_exec_multiple.json", "size": 82066, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_exec_parallel.json", "path": "BFCL_v3_exec_parallel.json", "size": 56281, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_exec_parallel_multiple.json", "path": "BFCL_v3_exec_parallel_multiple.json", "size": 73943, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_exec_simple.json", "path": "BFCL_v3_exec_simple.json", "size": 87953, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_irrelevance.json", "path": "BFCL_v3_irrelevance.json", "size": 160114, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_java.json", "path": "BFCL_v3_java.json", "size": 85919, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_javascript.json", "path": "BFCL_v3_javascript.json", "size": 46713, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_live_irrelevance.json", "path": "BFCL_v3_live_irrelevance.json", "size": 2202715, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_live_multiple.json", "path": "BFCL_v3_live_multiple.json", "size": 3891342, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_live_parallel.json", "path": "BFCL_v3_live_parallel.json", "size": 15649, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_live_parallel_multiple.json", "path": "BFCL_v3_live_parallel_multiple.json", "size": 82332, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_live_relevance.json", "path": "BFCL_v3_live_relevance.json", "size": 54134, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_live_simple.json", "path": "BFCL_v3_live_simple.json", "size": 260128, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_multi_turn_base.json", "path": "BFCL_v3_multi_turn_base.json", "size": 391058, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_multi_turn_composite.json", "path": "BFCL_v3_multi_turn_composite.json", "size": 404501, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_multi_turn_long_context.json", "path": "BFCL_v3_multi_turn_long_context.json", "size": 392651, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_multi_turn_miss_func.json", "path": "BFCL_v3_multi_turn_miss_func.json", "size": 401840, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_multi_turn_miss_param.json", "path": "BFCL_v3_multi_turn_miss_param.json", "size": 403181, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_multiple.json", "path": "BFCL_v3_multiple.json", "size": 316583, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_parallel.json", "path": "BFCL_v3_parallel.json", "size": 172094, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_parallel_multiple.json", "path": "BFCL_v3_parallel_multiple.json", "size": 347080, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_rest.json", "path": "BFCL_v3_rest.json", "size": 208186, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_simple.json", "path": "BFCL_v3_simple.json", "size": 280474, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/BFCL_v3_sql.json", "path": "BFCL_v3_sql.json", "size": 152641, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/README.md", "path": "README.md", "size": 15282, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/eval.yaml", "path": "eval.yaml", "size": 736, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/gorilla_file_system.json", "path": "multi_turn_func_doc/gorilla_file_system.json", "size": 13951, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/math_api.json", "path": "multi_turn_func_doc/math_api.json", "size": 9158, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/message_api.json", "path": "multi_turn_func_doc/message_api.json", "size": 6097, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/posting_api.json", "path": "multi_turn_func_doc/posting_api.json", "size": 10573, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/ticket_api.json", "path": "multi_turn_func_doc/ticket_api.json", "size": 6577, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/trading_bot.json", "path": "multi_turn_func_doc/trading_bot.json", "size": 14075, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/travel_booking.json", "path": "multi_turn_func_doc/travel_booking.json", "size": 15930, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/multi_turn_func_doc/vehicle_control.json", "path": "multi_turn_func_doc/vehicle_control.json", "size": 17545, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_java.json", "path": "possible_answer/BFCL_v3_java.json", "size": 15707, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_javascript.json", "path": "possible_answer/BFCL_v3_javascript.json", "size": 7529, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_live_multiple.json", "path": "possible_answer/BFCL_v3_live_multiple.json", "size": 199668, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_live_parallel.json", "path": "possible_answer/BFCL_v3_live_parallel.json", "size": 4974, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_live_parallel_multiple.json", "path": "possible_answer/BFCL_v3_live_parallel_multiple.json", "size": 7420, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_live_simple.json", "path": "possible_answer/BFCL_v3_live_simple.json", "size": 46971, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_multi_turn_base.json", "path": "possible_answer/BFCL_v3_multi_turn_base.json", "size": 80428, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_multi_turn_composite.json", "path": "possible_answer/BFCL_v3_multi_turn_composite.json", "size": 115938, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_multi_turn_long_context.json", "path": "possible_answer/BFCL_v3_multi_turn_long_context.json", "size": 116024, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_multi_turn_miss_func.json", "path": "possible_answer/BFCL_v3_multi_turn_miss_func.json", "size": 82136, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_multi_turn_miss_param.json", "path": "possible_answer/BFCL_v3_multi_turn_miss_param.json", "size": 82360, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_multiple.json", "path": "possible_answer/BFCL_v3_multiple.json", "size": 32254, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_parallel.json", "path": "possible_answer/BFCL_v3_parallel.json", "size": 65905, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_parallel_multiple.json", "path": "possible_answer/BFCL_v3_parallel_multiple.json", "size": 74601, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_simple.json", "path": "possible_answer/BFCL_v3_simple.json", "size": 60809, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/possible_answer/BFCL_v3_sql.json", "path": "possible_answer/BFCL_v3_sql.json", "size": 20541, "status": "uploaded" } ], "id": "gorilla-llm/Berkeley-Function-Calling-Leaderboard", "license": "apache-2.0", "purpose": "Holdout function-calling evaluation; do not train on this unless creating synthetic variants.", "revision": "61fc0608cfd831fcfbbaa676ebdfef0ed963eeda", "slug": "berkeley-function-calling-leaderboard" }, { "bytes_uploaded": 90129198, "category": "coding", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/self-oss-instruct-sc2-exec-filter-50k/356bb069eee8/README.md", "path": "README.md", "size": 1040, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/self-oss-instruct-sc2-exec-filter-50k/356bb069eee8/data/train-00000-of-00001.parquet", "path": "data/train-00000-of-00001.parquet", "size": 90128158, "status": "uploaded" } ], "id": "bigcode/self-oss-instruct-sc2-exec-filter-50k", "license": "odc-by", "purpose": "Coding instruction SFT from SelfCodeAlign.", "revision": "356bb069eee815daa6e23e9a282eeefe1490ad44", "slug": "self-oss-instruct-sc2-exec-filter-50k" }, { "bytes_uploaded": 37384124, "category": "coding", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/evolvecoder-22k/73fa2c3f56f2/README.md", "path": "README.md", "size": 2339, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/evolvecoder-22k/73fa2c3f56f2/data/train-00000-of-00001.parquet", "path": "data/train-00000-of-00001.parquet", "size": 37381785, "status": "uploaded" } ], "id": "TIGER-Lab/EvolveCoder-22K", "license": "apache-2.0", "purpose": "Competitive-programming tasks with adversarial/evolved tests.", "revision": "73fa2c3f56f283410ba2d78a6ceacbb1ff372b1f", "slug": "evolvecoder-22k" }, { "bytes_uploaded": 99160155, "category": "coding", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/acecode-v1-1-69k/9d74afc8549d/README.md", "path": "README.md", "size": 4049, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/acecode-v1-1-69k/9d74afc8549d/data/train-00000-of-00001.parquet", "path": "data/train-00000-of-00001.parquet", "size": 99156106, "status": "uploaded" } ], "id": "TIGER-Lab/AceCode-V1.1-69K", "license": "mit", "purpose": "Coding problems with tests for code reasoning and verification.", "revision": "9d74afc8549d048bdd23959e4115af8d87620c08", "slug": "acecode-v1-1-69k" }, { "bytes_uploaded": 87756597, "category": "reasoning", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/webinstruct-verified/3e8a350b3a93/README.md", "path": "README.md", "size": 5087, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/webinstruct-verified/3e8a350b3a93/data/test-00000-of-00001.parquet", "path": "data/test-00000-of-00001.parquet", "size": 194902, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/webinstruct-verified/3e8a350b3a93/data/train-00000-of-00001.parquet", "path": "data/train-00000-of-00001.parquet", "size": 43775058, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/webinstruct-verified/3e8a350b3a93/data/train_legacy-00000-of-00001.parquet", "path": "data/train_legacy-00000-of-00001.parquet", "size": 43781550, "status": "uploaded" } ], "id": "TIGER-Lab/WebInstruct-verified", "license": "apache-2.0", "purpose": "Verified web-derived reasoning/instruction data, useful as auxiliary SFT.", "revision": "3e8a350b3a935d68fe70bdf379692500abc9ff51", "slug": "webinstruct-verified" }, { "bytes_uploaded": 2055936, "category": "gui_grounding", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train/01f6d9935139/README.md", "path": "README.md", "size": 9282, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train/01f6d9935139/fiftyone.yml", "path": "fiftyone.yml", "size": 97, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train/01f6d9935139/metadata.json", "path": "metadata.json", "size": 11169, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train/01f6d9935139/samples.json", "path": "samples.json", "size": 2035388, "status": "uploaded" } ], "id": "Voxel51/FiftyOne-GUI-Grounding-Train", "license": "apache-2.0", "purpose": "Small GUI screenshot grounding set for visual UI understanding.", "revision": "01f6d99351399bee5291346cb5942fd3318b4cb6", "slug": "fiftyone-gui-grounding-train" }, { "bytes_uploaded": 15766174, "category": "gui_grounding", "files": [ { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train-with-synthetic/3deedc5d3667/README.md", "path": "README.md", "size": 14002, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train-with-synthetic/3deedc5d3667/fiftyone.yml", "path": "fiftyone.yml", "size": 118, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train-with-synthetic/3deedc5d3667/metadata.json", "path": "metadata.json", "size": 11698, "status": "uploaded" }, { "gcs": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train-with-synthetic/3deedc5d3667/samples.json", "path": "samples.json", "size": 15740356, "status": "uploaded" } ], "id": "Voxel51/FiftyOne-GUI-Grounding-Train-with-Synthetic", "license": "apache-2.0", "purpose": "GUI grounding with additional synthetic examples.", "revision": "3deedc5d3667696aff317e5e8a3b47d83b9fb48c", "slug": "fiftyone-gui-grounding-train-with-synthetic" } ], "dry_run": false, "generated_at": "2026-06-09T13:28:02+00:00" } main() { require enable_apis ensure_service_account ensure_api_key ensure_artifact_registry build_model_image build_serve_image maybe_replace_service deploy_service print_summary } from google.cloud import aiplatform | Property | Value | |---|---| | Served model name | `maximo-helios-preview` | | Base model | `google/gemma-4-26B-A4B-it` (GGUF from `unsloth/gemma-4-26B-A4B-it-GGUF`) | | Quant | `UD-Q4_K_M` (~14 GB) + `mmproj-BF16.gguf` (vision) | | Engine | `llama.cpp` / `llama-server` (`--jinja` tool calling, `--mmproj` vision) | | Endpoint | `/v1/chat/completions`, `/v1/models`, `/v1/completions` | | Auth | `Authorization: Bearer ` (key in Secret Manager) | | Compute | CPU 8 vCPU / 32Gi (default) or L4 GPU; both scale to zero | | Cost when idle | **$0** (min-instances=0) | #!/usr/bin/env python3 """Print a compact summary of generated datasets.""" def main() -> None: manifest = build_all(parse_args()) print(json.dumps({"generated_at": manifest["generated_at"], "files": manifest["files"]}, indent=2)) deploy_api() { local vllm_url vllm_url="$("${GCLOUD}" run services describe "${VLLM_SERVICE}" --project "${PROJECT}" --region "${REGION}" --format='value(status.url)')" log "vLLM internal URL: ${vllm_url}" Uploads the VibeThinker-3B vLLM model to Vertex AI Model Registry, creates an endpoint, and deploys with min_replica_count=0 (scale-to-zero). Re-running is safe: existing model/endpoint with the same display name is reused. main "$@" def parse_imported_routes(index_path: Path) -> dict[str, Path]: if not index_path.exists(): return {} text = read_text(index_path) imports: dict[str, Path] = {} for match in re.finditer(r'import\s+(\w+)\s+from\s+"\.\/routes\/([^"]+)"', text): imports[match.group(1)] = index_path.parent / "routes" / f"{match.group(2)}.ts" return imports #!/usr/bin/env python3 """Summarize the public dataset ingest manifest.""" def ingest_dataset(dataset: dict[str, Any], config: dict[str, Any], cache_root: Path, dry_run: bool) -> dict[str, Any]: repo_id = dataset["id"] slug = dataset["slug"] project = config["project"] bucket = config["bucket"] max_dataset_bytes = int(dataset.get("max_dataset_bytes", 250_000_000)) max_file_bytes = int(dataset.get("max_file_bytes", max_dataset_bytes)) print(f"\n==> {repo_id}") info = dataset_api(repo_id) revision = info.get("sha") or "main" siblings = info.get("siblings") or [] files: list[dict[str, Any]] = [] total = 0 dataset_dir = cache_root / slug / revision[:12] if dataset_dir.exists() and not dry_run: shutil.rmtree(dataset_dir) for sibling in siblings: if total >= max_dataset_bytes: files.append({"path": sibling.get("rfilename") or "", "size": int(sibling.get("size") or 0), "status": "skipped-dataset-cap"}) continue name = sibling.get("rfilename") or "" if not name or not file_allowed(name): continue size = int(sibling.get("size") or 0) if size and size > max_file_bytes: files.append({"path": name, "size": size, "status": "skipped-too-large"}) continue if size and total + size > max_dataset_bytes: files.append({"path": name, "size": size, "status": "skipped-dataset-cap"}) continue if not size and total >= max_dataset_bytes: files.append({"path": name, "size": size, "status": "skipped-dataset-cap"}) continue local = dataset_dir / name gcs = f"{bucket}/raw/public/{slug}/{revision[:12]}/{name}" if dry_run: files.append({"path": name, "size": size, "status": "would-download", "gcs": gcs}) total += size continue url = resolve_url(repo_id, revision, name) try: remaining_budget = max(1, max_dataset_bytes - total) downloaded = download_file(url, local, min(max_file_bytes, remaining_budget)) total += downloaded copy_to_gcs(local, gcs, project) files.append({"path": name, "size": downloaded, "status": "uploaded", "gcs": gcs}) print(f"uploaded {downloaded:,} bytes -> {gcs}") time.sleep(0.25) except (urllib.error.HTTPError, urllib.error.URLError, ValueError, subprocess.CalledProcessError) as error: files.append({"path": name, "size": size, "status": "error", "error": str(error)}) print(f"error {name}: {error}", file=sys.stderr) return { "id": repo_id, "slug": slug, "category": dataset.get("category"), "license": dataset.get("license"), "purpose": dataset.get("purpose"), "revision": revision, "bytes_uploaded": sum(file.get("size", 0) for file in files if file.get("status") == "uploaded"), "files": files, } import os import time from typing import Optional """Idempotent deploy of the Helios Nano Preview Vertex AI endpoint. def parse_route_mounts(index_path: Path) -> list[RouteMount]: imports = parse_imported_routes(index_path) text = read_text(index_path) mounts: list[RouteMount] = [] for block_match in re.finditer(r"app\.use\((.*?)\);", text, flags=re.DOTALL): block = block_match.group(1) mount_match = re.search(r'["\']([^"\']+)["\']', block) if not mount_match: continue mount = mount_match.group(1) for router_name, route_file in imports.items(): if re.search(rf"\b{re.escape(router_name)}\b", block): mounts.append(RouteMount(mount=mount, router_name=router_name, route_file=route_file)) break return mounts def read_text(path: Path) -> str: try: return path.read_text(encoding="utf-8") except UnicodeDecodeError: return path.read_text(encoding="utf-8", errors="ignore") def deploy_to_endpoint(model: aiplatform.Model, endpoint: aiplatform.Endpoint) -> None: deployed_models = list(endpoint.list_models()) if deployed_models: print(f"[vertex] Endpoint already has {len(deployed_models)} model(s) deployed — skipping redeploy.") return print(f"[vertex] Deploying {MODEL_DISPLAY} to {endpoint.resource_name} ({MACHINE_TYPE}, {ACC_COUNT}x {ACC_TYPE}, min={MIN_REPL}, max={MAX_REPL})…") model.deploy( endpoint=endpoint, machine_type=MACHINE_TYPE, accelerator_type=ACC_TYPE, accelerator_count=ACC_COUNT, min_replica_count=MIN_REPL, max_replica_count=MAX_REPL, traffic_percentage=100, deploy_request_timeout=CONFIG["compute"]["timeout_seconds"], service_account=SERVICE_ACCOUNT, ) PROJECT="${PROJECT:-project-6168b668-98c9-444b-b27}" REGION="${REGION:-europe-west1}" GCLOUD="${GCLOUD:-/Users/johnsondaniel/google-cloud-sdk/bin/gcloud}" ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" CONFIG="${ROOT}/configs/helios_preview.json" DEPLOY_DIR="${ROOT}/deploy/helios-preview" #!/usr/bin/env bash # Container entrypoint for "maximo helios preview". # Runs two processes in one container: # 1. llama-server on 127.0.0.1:8081 (the model; internal only) # 2. injector.py on 0.0.0.0:8080 (public: API-key auth + identity injection) # # The model keeps its embedded chat template (so vision + tool calling work); # identity is injected by the proxy, not by template surgery. set -euo pipefail set -euo pipefail def parse_router_routes(route_file: Path) -> list[tuple[str, str]]: if not route_file.exists(): return [] text = read_text(route_file) routes: list[tuple[str, str]] = [] for match in re.finditer(r"router\.(get|post|put|patch|delete)\s*\(\s*['\"]([^'\"]+)['\"]", text, flags=re.DOTALL): routes.append((match.group(1).upper(), match.group(2))) return routes def summarize_file(path: Path) -> dict[str, Any]: rows = 0 if path.exists() and path.suffix == ".jsonl": with path.open("r", encoding="utf-8") as handle: rows = sum(1 for _ in handle) return { "path": str(path.relative_to(REPO_ROOT)), "rows": rows, "bytes": path.stat().st_size if path.exists() else 0, "sha256": sha256_file(path) if path.exists() else None, } The model weights are **baked into the container image** (built in Cloud Build) so a cold start loads from the local image instead of re-downloading ~14 GB. ensure_artifact_registry() { if "${GCLOUD}" artifacts repositories describe "${AR_REPO}" --project "${PROJECT}" --location "${REGION}" >/dev/null 2>&1; then log "Artifact Registry repo exists: ${AR_REPO}" else log "Creating Artifact Registry repo: ${AR_REPO}" "${GCLOUD}" artifacts repositories create "${AR_REPO}" \ --project "${PROJECT}" \ --location "${REGION}" \ --repository-format=docker \ --description="Helios Nano Preview auth proxy images" >/dev/null fi } #!/usr/bin/env bash # Smoke-test helper for the maximo helios preview endpoint. # # Usage: # ./scripts/invoke_helios_preview.sh key # print the API key # ./scripts/invoke_helios_preview.sh url # print the endpoint URL # ./scripts/invoke_helios_preview.sh models # GET /v1/models # ./scripts/invoke_helios_preview.sh chat "your prompt" # chat completion # ./scripts/invoke_helios_preview.sh tools "prompt" # tool-calling test # # The first chat/tools call after idle triggers a cold start (~60-120s on CPU). "${GCLOUD}" storage cp "${ROOT}/data/processed/sft/mytabulon_tool_calling_sft.jsonl" "${BUCKET}/processed/sft/mytabulon_tool_calling_sft.jsonl" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/sft/maximoai_repo_coding_sft.jsonl" "${BUCKET}/processed/sft/maximoai_repo_coding_sft.jsonl" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/pretrain/maximoai_code_continued_pretrain.jsonl" "${BUCKET}/processed/pretrain/maximoai_code_continued_pretrain.jsonl" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/eval/mytabulon_tool_calling_eval.jsonl" "${BUCKET}/eval/mytabulon_tool_calling_eval.jsonl" --project "${PROJECT}" def build_pretrain_rows(source_roots: dict[str, Path], max_files: int) -> list[dict[str, Any]]: rows: list[dict[str, Any]] = [] for repo_name, root in source_roots.items(): for file_index, path in enumerate(iter_code_files(root)): if file_index >= max_files: break rel = path.relative_to(root) text = redact_text(read_text(path)) if not text.strip(): continue lang = path.suffix.lower().lstrip(".") or "text" for chunk_index, chunk in enumerate(chunk_text(text)): rendered = ( f"Repository: {repo_name}\n" f"Path: {rel}\n" f"Purpose: Learn MaximoAI/MyTabulon implementation patterns, API shapes, UI flows, and coding style.\n\n" f"```{lang}\n{chunk}\n```" ) rows.append( { "id": f"code_pretrain_{sha256_text(repo_name + str(rel) + str(chunk_index))[:16]}", "dataset": "maximoai_code_continued_pretrain", "text": rendered, "metadata": { "repo": repo_name, "path": str(rel), "chunk_index": chunk_index, "sha256": sha256_text(chunk), "privacy": "source-derived-redacted", }, } ) return rows def file_allowed(name: str) -> bool: if Path(name).name in SKIP_NAMES: return False suffixes = Path(name).suffixes if not suffixes: return False if suffixes[-1] in SAFE_EXTENSIONS: return True return any(suffix in SAFE_EXTENSIONS for suffix in suffixes) ROOT = Path(__file__).resolve().parents[1] MANIFEST = ROOT / "data" / "processed" / "manifests" / "public_dataset_ingest_manifest.json" ```bash bash scripts/create_model_bucket.sh ``` def _check_key(request: Request) -> bool: raw = request.headers.get(HEADER, "") if not raw: return False parts = raw.split(None, 1) if len(parts) != 2 or parts[0] != SCHEME: return False presented = parts[1].strip() expected = _load_key() if len(presented) != len(expected): return False result = 0 for a, b in zip(presented, expected): result |= ord(a) ^ ord(b) return result == 0 | Dataset | Approx size | License note | Use | | --- | ---: | --- | --- | | `Team-ACE/ToolACE` | 10K-100K rows, about 37 MB | Apache-2.0 | General function/tool-calling SFT | | `NousResearch/hermes-function-calling-v1` | about 64 MB uploaded | Apache-2.0 | Function calling, JSON mode, agentic tool traces | | `glaiveai/glaive-function-calling-v2` | about 259 MB uploaded | Apache-2.0 | Broad function calling with tool/no-tool behavior | | `gorilla-llm/Berkeley-Function-Calling-Leaderboard` | about 11 MB uploaded | Apache-2.0 | Function-calling eval suite | | `Salesforce/xlam-function-calling-60k` | 60K rows | Verify before commercial use | Function-calling SFT | | `bigcode/self-oss-instruct-sc2-exec-filter-50k` | 50,467 rows, about 90 MB | ODC-BY | Coding instruction SFT | | `TIGER-Lab/EvolveCoder-22K` | about 36 MB uploaded | Apache-2.0 | Test-aware coding | | `TIGER-Lab/AceCode-V1.1-69K` | about 95 MB uploaded | MIT | Code reasoning and tests | | `TIGER-Lab/WebInstruct-verified` | about 84 MB uploaded | Apache-2.0 | Auxiliary reasoning | | `Voxel51/FiftyOne-GUI-Grounding-Train` | about 2 MB uploaded | Apache-2.0 | GUI grounding | | `Voxel51/FiftyOne-GUI-Grounding-Train-with-Synthetic` | about 15 MB uploaded | Apache-2.0 | GUI grounding with synthetic examples | | `m-a-p/CodeFeedback-Filtered-Instruction` | 60,735 rows | Verify before commercial use | Coding instruction and feedback SFT | | `HuggingFaceM4/Docmatix` | 1M-10M rows, about 982 GB | MIT | Document image VQA/OCR; use a curated subset first | # maximo helios preview import argparse import json import os import shutil import subprocess import sys import time import urllib.error import urllib.parse import urllib.request from datetime import datetime, timezone from pathlib import Path from typing import Any Read `data/processed/manifests/dataset_manifest.json` for exact generated counts, sizes, and checksums. if __name__ == "__main__": main() - Repo: `/Users/johnsondaniel/Documents/maximoai-models` - Model bucket: `gs://maximoai-models-976606885534` - Cloud project: `project-6168b668-98c9-444b-b27` - Region: `europe-west1` """Identity + API-key injector that sits in front of llama-server. # Branding - When forking/rebranding models, use the "maximo helios" naming convention (e.g., "maximo helios nano preview"). Confidence: 0.80 app = FastAPI(title="maximo-helios-nano-preview-auth-proxy") def infer_properties(method: str, path: str) -> dict[str, Any]: properties: dict[str, Any] = {} required: list[str] = [] for param in route_params(path): properties[param] = {"type": "string", "description": f"Path parameter {param}."} required.append(param) if method == "GET": properties["limit"] = {"type": "integer", "minimum": 1, "maximum": 100, "default": 25} properties["search"] = {"type": "string", "description": "Optional search or filter text."} if method in {"POST", "PUT", "PATCH"}: properties["payload"] = { "type": "object", "description": "Request body for this MyTabulon operation. Use the backend route/controller for exact shape.", "additionalProperties": True, } required.append("payload") if method == "POST" and "/ai-computer/runs" in path: properties["agentType"] = { "type": "string", "enum": ["maximo_computer", "codex", "maximo_syntax", "hermes", "openclaw"], "default": "maximo_computer", } properties["prompt"] = {"type": "string", "description": "Executable task for the selected agent."} required.extend(["agentType", "prompt"]) return {"type": "object", "properties": properties, "required": sorted(set(required))} Identity is injected, not trained, so a fine-tune later makes it intrinsic. """ from __future__ import annotations ## Public Sources def now_iso() -> str: return datetime.now(timezone.utc).isoformat(timespec="seconds") #!/usr/bin/env bash set -euo pipefail # MaximoAI Model Datasets set -euo pipefail grant_user_invoker() { local user user="$("${GCLOUD}" config get-value account 2>/dev/null)" if [[ -z "${user}" || "${user}" == "(unset)" ]]; then log "No active gcloud account; skipping user invoker grant." return 0 fi log "Granting ${user} invoker on ${API_SERVICE}…" "${GCLOUD}" run services add-iam-policy-binding "${API_SERVICE}" \ --project "${PROJECT}" \ --region "${REGION}" \ --member="user:${user}" \ --role="roles/run.invoker" >/dev/null } def tool_arguments(method: str, path: str) -> dict[str, Any]: args = {param: param_value(param) for param in route_params(path)} if method == "GET": args["limit"] = 25 if method in {"POST", "PUT", "PATCH"}: args["payload"] = {"demo": True, "source": "maximoai-models-dataset"} if method == "POST" and "/ai-computer/runs" in path: args["agentType"] = "codex" args["prompt"] = "Inspect the MyTabulon frontend and propose a focused fix for the reported issue." return args #!/usr/bin/env bash # Smoke-test helper for the maximo helios nano preview endpoint. # Usage: # ./scripts/invoke_helios_nano_preview.sh models # ./scripts/invoke_helios_nano_preview.sh chat "Solve 2x+3=11" # ./scripts/invoke_helios_nano_preview.sh stream "Write a haiku" import httpx from fastapi import FastAPI, Request, Response from fastapi.responses import JSONResponse, StreamingResponse from starlette.background import BackgroundTask if __name__ == "__main__": main() import json import os import sys from pathlib import Path Use `configs/mixes/qwen35_4b_first_sft_mix.json` for the first Qwen3.5-4B LoRA/QLoRA SFT plan. Use `configs/mixes/qwen35_4b_continued_pretrain_mix.json` for a small continued-pretraining pass. Use `configs/mixes/qwen35_4b_public_augmented_sft_mix.json` once the public layer has been converted into the final Qwen chat/tool-call format. The expanded public layer currently includes tool-calling, function-calling evals, coding, reasoning, and GUI grounding datasets. From `/Users/johnsondaniel/Documents/maximoai-models`: ```bash python3 scripts/download_public_datasets.py python3 scripts/summarize_public_ingest.py ``` [cmd]: https://commandcode.ai/ Create/check the dedicated model bucket only: MODEL_DISPLAY = "helios-nano-vllm" ENDPOINT_DISPLAY = CONFIG["auth_proxy"]["internal_endpoint_display_name"] import json import os import time from typing import Optional "${GCLOUD}" storage buckets create "${BUCKET}" \ --project "${PROJECT}" \ --location "${REGION}" \ --uniform-bucket-level-access echo "[entrypoint] starting identity injector on 0.0.0.0:8080" python3 -m uvicorn injector:app --app-dir /app --host 0.0.0.0 --port 8080 --workers 1 & INJ_PID=$! post_chat() { local body="$1" curl -sS --max-time 600 "$(url)/v1/chat/completions" \ -H "Authorization: Bearer $(key)" \ -H "Content-Type: application/json" \ -d "${body}" | python3 -m json.tool } echo "[entrypoint] starting llama-server (ctx=${CTX_SIZE}, KV=${CACHE_TYPE_K}/${CACHE_TYPE_V}) on 127.0.0.1:8081" # shellcheck disable=SC2086 /app/llama-server \ --model "/models/${MODEL_FILE}" \ --mmproj "/models/${MMPROJ_FILE}" \ --alias "${SERVED_NAME}" \ --host 127.0.0.1 --port 8081 \ --jinja \ --ctx-size "${CTX_SIZE}" \ --parallel "${PARALLEL}" \ ${KV_ARGS} \ --temp 1.0 --top-p 0.95 --top-k 64 \ --threads "${THREADS}" --threads-batch "${THREADS_BATCH}" ${EXTRA_ARGS} & LLAMA_PID=$! build_and_push() { log "Configuring docker auth for ${AR_HOST}…" "${GCLOUD}" auth configure-docker "${AR_HOST}" --project "${PROJECT}" >/dev/null log "Building auth-proxy image ${IMAGE_TAG}…" docker build --tag "${IMAGE_TAG}" --file "${DEPLOY_DIR}/Dockerfile" "${DEPLOY_DIR}" log "Pushing auth-proxy image…" docker push "${IMAGE_TAG}" } build_serve_image() { if [[ "${FORCE_SERVE_BUILD:-0}" != "1" ]] \ && "${GCLOUD}" artifacts docker images describe "${SERVE_IMAGE}" --project "${PROJECT}" >/dev/null 2>&1; then log "Serve image already exists: ${SERVE_IMAGE} (set FORCE_SERVE_BUILD=1 to rebuild)." return 0 fi # Layers the identity injector + entrypoint on top of the model image. Fast: # no GGUF re-download, just adds Python + two small files. log "Building serve image (injector + entrypoint) on top of model image…" "${GCLOUD}" builds submit "${DEPLOY_DIR}" \ --project "${PROJECT}" \ --config "${DEPLOY_DIR}/cloudbuild.serve.yaml" \ --substitutions "_IMAGE=${SERVE_IMAGE},_MODEL_IMAGE=${MODEL_IMAGE}" } from __future__ import annotations maybe_replace_service() { # Cloud Run rolling deploys keep the OLD revision live until the NEW one passes # its startup probe -> 32Gi (old) + 32Gi (new) = 64Gi briefly, which blows past # this region's 40Gi MemAllocPerProjectRegion quota. The new revision then never # schedules and the deploy "fails its startup probe" (this is what bit the 26B # deploys). Deleting the service first means only the new revision needs memory. # The image builds above already finished while the old revision served, so the # endpoint is only down for the brief delete->deploy window here. if [[ "${REPLACE_SERVICE:-0}" == "1" ]] \ && "${GCLOUD}" run services describe "${SERVICE}" --project "${PROJECT}" --region "${REGION}" >/dev/null 2>&1; then log "REPLACE_SERVICE=1 -> deleting existing ${SERVICE} to dodge the 40Gi rollout quota wall…" "${GCLOUD}" run services delete "${SERVICE}" --project "${PROJECT}" --region "${REGION}" --quiet fi } ROOT = Path(__file__).resolve().parents[1] MANIFEST = ROOT / "data" / "processed" / "manifests" / "dataset_manifest.json" from __future__ import annotations ROOT = Path(__file__).resolve().parent.parent.parent sys.path.insert(0, str(ROOT)) Download/sync approved public datasets: "${GCLOUD}" storage buckets describe "${BUCKET}" --project "${PROJECT}" >/dev/null 2>&1 && { echo "Bucket already exists: ${BUCKET}" exit 0 } @app.get("/") async def root() -> dict: return { "service": "maximo-helios-nano-preview", "upstream": UPSTREAM, "openai_compatible": True, "endpoints": ["/v1/models", "/v1/chat/completions", "/v1/completions"], } def _load_key(force: bool = False) -> str: global _cached_key, _cached_at now = time.time() if not force and _cached_key is not None and (now - _cached_at) < _CACHE_TTL: return _cached_key name = SECRET_RESOURCE if not name.startswith("projects/"): name = f"projects/{os.environ.get('GOOGLE_CLOUD_PROJECT', '')}/secrets/{SECRET_RESOURCE}/versions/latest" resp = _get_client().access_secret_version(request={"name": name}) _cached_key = resp.payload.data.decode("utf-8").strip() _cached_at = now return _cached_key require() { command -v "${GCLOUD}" >/dev/null || { echo "gcloud not found at ${GCLOUD}"; exit 1; } command -v docker >/dev/null || { echo "docker not found in PATH"; exit 1; } [[ -f "${CONFIG}" ]] || { echo "Missing config: ${CONFIG}"; exit 1; } [[ -f "${DEPLOY_DIR}/Dockerfile" ]] || { echo "Missing deploy dir: ${DEPLOY_DIR}"; exit 1; } } enable_apis() { log "Enabling required APIs (idempotent)…" "${GCLOUD}" services enable \ run.googleapis.com \ cloudbuild.googleapis.com \ artifactregistry.googleapis.com \ secretmanager.googleapis.com \ --project "${PROJECT}" >/dev/null } def vllm_args() -> list[str]: return [ "python", "-m", "vllm.entrypoints.api_server", "--host=0.0.0.0", "--port=8080", f"--model={HF_MODEL_ID}", f"--served-model-name={SERVED_NAME}", f"--tensor-parallel-size={TP}", "--swap-space=16", f"--max-model-len={MAX_MODEL_LEN}", f"--dtype={DTYPE}", f"--max-num-seqs={MAX_NUM_SEQS}", f"--gpu-memory-utilization={GPU_MEM_UTIL}", "--enable-prefix-caching", "--enable-chunked-prefill", "--disable-log-stats", ] # ML Deployment - Deploy ML models to GCP cloud. Confidence: 0.50 - Use OpenAI-compatible API design (e.g., /v1/models endpoint) for model serving. Confidence: 0.60 - For GCP deployments, use services that can scale to zero when idle to minimize costs. Confidence: 0.85 - Consider Fireworks AI as an alternative deployment platform for ML models, especially when GCP Vertex AI has quota/availability issues. Confidence: 0.55 - Keep ML deployment costs at or below $5 per hour (hard ceiling the user specified). Skip any option that exceeds this (e.g., H100/B200 on-demand at $7+/hr). Confidence: 0.85 key() { "${GCLOUD}" secrets versions access latest --secret="${SECRET_NAME}" --project "${PROJECT}" } ensure_api_key() { if "${GCLOUD}" secrets describe "${SECRET_NAME}" --project "${PROJECT}" >/dev/null 2>&1; then log "Secret exists: ${SECRET_NAME}" if "${GCLOUD}" secrets versions list "${SECRET_NAME}" --project "${PROJECT}" 2>/dev/null | grep -q "^[0-9]"; then log "Re-using existing API key version." return 0 fi else log "Creating secret: ${SECRET_NAME}" "${GCLOUD}" secrets create "${SECRET_NAME}" \ --project "${PROJECT}" \ --replication-policy=automatic >/dev/null fi local key key="$(python3 -c 'import secrets; print("hlnp_" + secrets.token_urlsafe(32))')" printf '%s' "${key}" | "${GCLOUD}" secrets versions add "${SECRET_NAME}" \ --project "${PROJECT}" \ --data-file=- >/dev/null log "New API key generated. SECRET (save now, won't be shown again): ${key}" } ```bash python3 scripts/summarize_datasets.py rg -n "sk-[A-Za-z0-9]{20,}|AIza[A-Za-z0-9_-]{20,}|-----BEGIN [A-Z ]*PRIVATE KEY-----|Bearer [A-Za-z0-9._-]{20,}" data/processed ``` def _get_client() -> secretmanager.SecretManagerServiceClient: global _sm_client if _sm_client is None: _sm_client = secretmanager.SecretManagerServiceClient() return _sm_client { "name": "qwen35_4b_continued_pretrain_mix", "base_model": "Qwen/Qwen3.5-4B-Base", "goal": "Low-cost domain-adaptive pretraining before SFT.", "storage_bucket": "gs://maximoai-models-976606885534", "datasets": [ { "id": "maximoai_code_continued_pretrain", "path": "data/processed/pretrain/maximoai_code_continued_pretrain.jsonl", "weight": 0.70 }, { "id": "HuggingFaceM4/Docmatix-curated-subset", "path": "gs://maximoai-models-976606885534/raw/public/docmatix/subset/", "weight": 0.30, "requires_download": true, "notes": "Use a small subset first; full Docmatix is about TB scale." } ], "notes": [ "Run for a small token budget first and check evals before scaling.", "This is continued pretraining, not from-scratch pretraining." ] } def jsonl_write(path: Path, rows: list[dict[str, Any]]) -> None: path.parent.mkdir(parents=True, exist_ok=True) with path.open("w", encoding="utf-8") as handle: for row in rows: handle.write(json.dumps(row, ensure_ascii=False, sort_keys=True) + "\n") The existing MyTabulon upload bucket remains product storage only: This workspace keeps training data separate from MyTabulon product uploads. #!/usr/bin/env bash # Idempotent deploy of "maximo helios nano preview" on Cloud Run. # * vLLM service: helios-nano-vllm (private, 1x L4 GPU, min-instances=0) # * Auth proxy: helios-nano-api (private, validates Bearer API key) # Cost: scales to zero when idle. ~$0.21/hr only while a request is in-flight. def find_endpoint() -> aiplatform.Endpoint | None: for e in aiplatform.Endpoint.list(filter=f"display_name={ENDPOINT_DISPLAY}"): return e return None def build_screen_record_manifest(screen_records_root: Path) -> list[dict[str, Any]]: if not screen_records_root.exists(): return [] rows: list[dict[str, Any]] = [] for path in sorted(screen_records_root.rglob("*")): if not path.is_file() or path.suffix.lower() not in VISUAL_EXTENSIONS: continue stat = path.stat() mime_type = mimetypes.guess_type(str(path))[0] or "application/octet-stream" rows.append( { "id": f"screen_record_{sha256_text(str(path))[:12]}", "dataset": "maximo_screen_records_manifest", "local_path": str(path), "filename": path.name, "mime_type": mime_type, "bytes": stat.st_size, "sha256": sha256_file(path) if stat.st_size <= 256 * 1024 * 1024 else None, "gcs_target": f"gs://maximoai-models-976606885534/raw/maximo-screen-records/{path.name}", "training_use": "raw-visual-source-for-curated-video-or-image-supervision", } ) return rows def main() -> None: args = parse_args() config = load_config(args.config) cache_root = Path(config["local_cache"]) only = set(args.only) selected = [] for dataset in config["active"]: if only and dataset["slug"] not in only and dataset["id"] not in only: continue selected.append(dataset) manifest = { "generated_at": now_iso(), "config": str(args.config), "bucket": config["bucket"], "dry_run": args.dry_run, "datasets": [], } for dataset in selected: manifest["datasets"].append(ingest_dataset(dataset, config, cache_root, args.dry_run)) out_dir = REPO_ROOT / "data" / "processed" / "manifests" out_dir.mkdir(parents=True, exist_ok=True) out_path = out_dir / "public_dataset_ingest_manifest.json" out_path.write_text(json.dumps(manifest, indent=2, sort_keys=True) + "\n", encoding="utf-8") if not args.dry_run: copy_to_gcs(out_path, f"{config['bucket']}/manifests/public_dataset_ingest_manifest.json", config["project"]) print(json.dumps({"manifest": str(out_path), "datasets": len(manifest["datasets"])}, indent=2)) Build the local private datasets: echo "Synced local processed datasets to ${BUCKET}" HF_REPO="${HF_REPO:-unsloth/Qwen3.5-2B-GGUF}" MODEL_FILE="${MODEL_FILE:-Qwen3.5-2B-Q4_K_S.gguf}" # Q4_K_S: ~equal quality to Q4_K_M, slightly faster on CPU (accuracy/speed frontier) MMPROJ_FILE="${MMPROJ_FILE:-mmproj-BF16.gguf}" # vision projector — keep (model is multimodal) CTX_SIZE="${CTX_SIZE:-262144}" # 256K = model's trained max. Fits easily: 256K f16 KV ≈ ~12.8GB (total footprint ~18GB << 32Gi). PARALLEL="${PARALLEL:-1}" # 1 slot → a single request gets the FULL ctx-size. llama.cpp shares the KV budget across --parallel N slots, so N>1 would split 256K into N pieces. Trade: requests serialize per instance. CACHE_TYPE_K="${CACHE_TYPE_K:-f16}" # Set f16 KV cache (faster prefill on CPU than q8_0 dequantization overhead) CACHE_TYPE_V="${CACHE_TYPE_V:-f16}" INJECT_MODE="${INJECT_MODE:-system}" # 'system' replaces default system prompt THREADS="${THREADS:-8}" # 8 threads: optimal for Cloud Run execution speed based on empirical testing THREADS_BATCH="${THREADS_BATCH:-8}" # 8 batch threads for fast prompt ingestion def build_coding_sft_rows(source_roots: dict[str, Path], limit: int = 300) -> list[dict[str, Any]]: rows: list[dict[str, Any]] = [] interesting = re.compile(r"(route|controller|service|page|component|prompt|tool|agent|computer|automation)", re.I) files: list[tuple[str, Path, Path]] = [] for repo_name, root in source_roots.items(): for path in iter_code_files(root): rel = path.relative_to(root) if interesting.search(str(rel)): files.append((repo_name, root, path)) for repo_name, root, path in files[:limit]: rel = path.relative_to(root) text = redact_text(read_text(path)) excerpt = text[:1800] rows.append( { "id": f"coding_sft_{sha256_text(repo_name + str(rel))[:16]}", "dataset": "maximoai_repo_coding_sft", "messages": [ { "role": "system", "content": "You are a senior engineer working on MaximoAI and MyTabulon code.", }, { "role": "user", "content": ( f"In the {repo_name} repository, where should I look to understand or change " f"the behavior related to `{rel.name}`?" ), }, { "role": "assistant", "content": ( f"Start with `{rel}` in `{repo_name}`. It is part of the local MaximoAI/MyTabulon " f"codebase. Relevant excerpt:\n\n```text\n{excerpt}\n```\n\n" "Read the surrounding module before editing, keep changes scoped, and verify with " "the repo's existing build or test command." ), }, ], "metadata": { "repo": repo_name, "path": str(rel), "privacy": "source-derived-redacted", }, } ) return rows ## Notes & tradeoffs def _check_request_size(body: bytes) -> tuple[bool, str]: if not body: return True, "" try: data = json.loads(body) except Exception: return True, "" msgs = data.get("messages") if not isinstance(msgs, list): return True, "" total_chars = 0 for m in msgs: content = m.get("content") if isinstance(content, str): total_chars += len(content) elif isinstance(content, list): for part in content: if isinstance(part, dict) and part.get("type") == "text": total_chars += len(part.get("text", "")) is_cpu = os.environ.get("COMPUTE", "cpu").lower() == "cpu" if is_cpu: stream = bool(data.get("stream", False)) if stream: # For streaming, limit is 260,000 chars (~65,000 tokens) limit = 260000 msg = ( f"Prompt is too long ({total_chars} characters, approx {total_chars // 4} tokens). " f"Streaming mode is capped at ~65,000 tokens to prevent excessive CPU prefill lockup. " f"Please reduce prompt size or upgrade service to GPU." ) else: # For non-streaming, limit is 80,000 chars (~20,000 tokens) to prevent timeout limit = 80000 msg = ( f"Prompt is too long ({total_chars} characters, approx {total_chars // 4} tokens). " f"Non-streaming requests are capped at ~20,000 tokens to prevent client timeouts. " f"Please use streaming (stream: true) for larger prompts up to 65,000 tokens." ) if total_chars > limit: return False, msg return True, "" def redact_text(text: str) -> str: safe_lines: list[str] = [] for line in text.splitlines(): if SECRET_PATTERN.search(line): key = line.split("=", 1)[0].split(":", 1)[0].strip() safe_lines.append(f"{key}: [REDACTED_SECRET_LINE]") else: line = INFRA_PATTERN.sub("[REDACTED_INFRA]", line) line = LONG_SECRET_PATTERN.sub(redact_long_secret_candidate, line) safe_lines.append(line) return "\n".join(safe_lines) CONFIG = json.loads((ROOT / "configs" / "helios_nano_preview.json").read_text()) from __future__ import annotations { "service": "maximo-helios-nano-preview", "model": { "huggingface_repo": "WeiboAI/VibeThinker-3B", "served_model_name": "maximo-helios-nano-preview", "dtype": "bfloat16", "max_model_len": 8192, "tensor_parallel_size": 1, "gpu_memory_utilization": 0.9, "max_num_seqs": 32, "sampling_defaults": { "temperature": 1.0, "top_p": 0.95, "top_k": -1 } }, "compute": { "platform": "vertex_ai_prediction", "region": "asia-southeast1", "machine_type": "g2-standard-4", "accelerator_type": "NVIDIA_L4", "accelerator_count": 1, "min_replica_count": 0, "max_replica_count": 1, "timeout_seconds": 600 }, "vllm": { "image": "us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-vllm-serve:20251205_0916_RC01", "port": 8080, "predict_route": "/generate", "health_route": "/ping", "shared_memory_mb": 16384 }, "auth_proxy": { "image_repo": "helios", "service_name": "helios-nano-api", "internal_endpoint_display_name": "helios-nano-vllm-endpoint", "secret_name": "helios-nano-api-key", "header_name": "Authorization", "header_scheme": "Bearer" }, "iam": { "service_account": "helios-nano-sa", "secret_accessor_role": "roles/secretmanager.secretAccessor", "vertex_ai_user_role": "roles/aiplatform.user", "run_invoker_role": "roles/run.invoker" } } url() { "${GCLOUD}" run services describe "${SERVICE}" --project "${PROJECT}" --region "${REGION}" --format='value(status.url)' } key() { "${GCLOUD}" secrets versions access latest --secret="${SECRET_NAME}" --project "${PROJECT}" } ensure_artifact_registry() { if "${GCLOUD}" artifacts repositories describe "${AR_REPO}" --project "${PROJECT}" --location "${REGION}" >/dev/null 2>&1; then log "Artifact Registry repo exists: ${AR_REPO}" else log "Creating Artifact Registry repo: ${AR_REPO}" "${GCLOUD}" artifacts repositories create "${AR_REPO}" \ --project "${PROJECT}" \ --location "${REGION}" \ --repository-format=docker \ --description="Helios serving images" >/dev/null fi } def is_safe_code_file(path: Path) -> bool: if path.name in EXCLUDED_FILENAMES: return False if path.suffix.lower() not in CODE_EXTENSIONS: return False return all(part not in EXCLUDED_DIRS for part in path.parts) #!/usr/bin/env python3 """Download approved public HF datasets and sync them into the model GCS bucket.""" - `maximoai-models/` in R2 `maximoai-mytabulon-backups` is also copied to B2 `maximoai-mytabulon-backups-fb` (US East), nightly and on every write, by Kydanet's mirror Worker. See the kydanet repo's `docs/cloudflare-fallback.md`. If R2 is down, read the same keys from that B2 bucket. - The GCS mirror (`gs://maximoai-models-976606885534`) is likely gone: Google billing closed in November 2026, and MyTabulon's GCS bucket answers 403. Don't count on it, and don't write new data there. def main() -> None: aiplatform.init(project=PROJECT, location=REGION) model = upload_model() endpoint = create_endpoint() deploy_to_endpoint(model, endpoint) print() print("=" * 60) print(" Vertex AI deployment complete") print("=" * 60) print(f" model : {model.resource_name}") print(f" endpoint : {endpoint.resource_name}") print(f" region : {REGION}") print(f" scale : {MIN_REPL}..{MAX_REPL} replicas (scale to zero)") print(f" raw url : https://{REGION}-aiplatform.googleapis.com/v1beta1/{endpoint.resource_name}") print() ## Quick Start if __name__ == "__main__": main() set -euo pipefail def iter_code_files(root: Path) -> list[Path]: if not root.exists(): return [] files: list[Path] = [] for path in root.rglob("*"): if not path.is_file(): continue if is_safe_code_file(path): files.append(path) return sorted(files) def chunk_text(text: str, max_chars: int = 6000, overlap: int = 400) -> list[str]: if len(text) <= max_chars: return [text] chunks: list[str] = [] start = 0 while start < len(text): end = min(len(text), start + max_chars) chunks.append(text[start:end]) if end >= len(text): break start = max(0, end - overlap) return chunks main() { require enable_apis ensure_service_account ensure_api_key ensure_artifact_registry build_and_push deploy_vllm grant_api_to_vllm_invoker deploy_api grant_user_invoker print_summary } def human_bytes(value: int) -> str: size = float(value) for unit in ["B", "KB", "MB", "GB"]: if size < 1024 or unit == "GB": return f"{size:.1f} {unit}" size /= 1024 return f"{size:.1f} GB" def main() -> None: manifest = json.loads(MANIFEST.read_text(encoding="utf-8")) print(f"Generated: {manifest['generated_at']}") print(f"GCS bucket: {manifest['gcs_bucket']}") for name, info in sorted(manifest["files"].items()): print(f"{name:18} {info['rows']:6} rows {human_bytes(info['bytes']):>9} {info['path']}") def build_all(args: argparse.Namespace) -> dict[str, Any]: output_root = REPO_ROOT / "data" / "processed" source_roots = { "mytabulon": args.mytabulon_root, "maximo-syntax-cli": args.maximo_syntax_root, "maximoai-ios": args.maximoai_app_root, } tool_specs, tool_sft, tool_eval = build_tool_datasets(args.mytabulon_root) pretrain_rows = build_pretrain_rows(source_roots, args.max_files_per_repo) coding_sft = build_coding_sft_rows(source_roots, args.coding_sft_limit) frontend_pages = build_frontend_page_manifest(args.mytabulon_root) screen_records = build_screen_record_manifest(args.screen_records_root) Gemma 4 **26B A4B** (Mixture-of-Experts, multimodal, Apache-2.0) served via **llama.cpp** as an **OpenAI-compatible API** on **Cloud Run**, scale-to-zero. def route_params(path: str) -> list[str]: return re.findall(r":([A-Za-z_][A-Za-z0-9_]*)", path) Run with: python3 deploy/helios-nano-preview/deploy_vertex.py """ from __future__ import annotations - Do not write training artifacts to `gs://mytabulon-mvp-uploads-976606885534`. - Do not train on production uploads, raw user chats, OAuth tokens, credentials, customer documents, or payment/accounting payloads unless a separate redaction/export pipeline has produced approved records. def param_value(name: str) -> str: return { "companyId": "company_demo_001", "sessionId": "session_demo_001", "messageId": "message_demo_001", "runId": "run_demo_001", "jobId": "job_demo_001", "workflowId": "workflow_demo_001", "profileId": "profile_demo_001", "actionId": "action_demo_001", "clientId": "client_demo_001", "invoiceId": "invoice_demo_001", "employeeId": "employee_demo_001", "leadId": "lead_demo_001", "dealId": "deal_demo_001", "customerId": "customer_demo_001", "fileId": "file_demo_001", }.get(name, f"{name}_demo") Dedicated model bucket: local -a flags=( --project "${PROJECT}" --region "${REGION}" --image "${SERVE_IMAGE}" --execution-environment gen2 --allow-unauthenticated --port 8080 --cpu 8 --memory 32Gi --no-cpu-throttling --cpu-boost --min-instances 0 --max-instances "${MAX_INSTANCES}" --concurrency "${CONCURRENCY}" --timeout 3600 --service-account "${SERVICE_ACCOUNT_EMAIL}" --set-secrets "/secrets/api-key=${SECRET_NAME}:latest" --set-env-vars "^|^${env_vars}" --startup-probe "httpGet.path=/health,httpGet.port=8080,initialDelaySeconds=60,failureThreshold=60,timeoutSeconds=10,periodSeconds=15" --labels "app=helios-preview,component=serve,compute=${COMPUTE}" ) if [[ "${COMPUTE}" == "gpu" ]]; then flags+=(--gpu 1 --gpu-type nvidia-l4 --no-gpu-zonal-redundancy) fi ## Files { "project": "project-6168b668-98c9-444b-b27", "bucket": "gs://maximoai-models-976606885534", "local_cache": "/private/tmp/maximoai-public-datasets", "active": [ { "id": "Team-ACE/ToolACE", "slug": "toolace", "category": "tool_calling", "license": "apache-2.0", "purpose": "General function/tool-calling SFT.", "max_dataset_bytes": 150000000 }, { "id": "NousResearch/hermes-function-calling-v1", "slug": "hermes-function-calling-v1", "category": "tool_calling", "license": "apache-2.0", "purpose": "Function-calling examples with tool schemas and ShareGPT-style traces.", "max_dataset_bytes": 180000000 }, { "id": "glaiveai/glaive-function-calling-v2", "slug": "glaive-function-calling-v2", "category": "tool_calling", "license": "apache-2.0", "purpose": "Large function-calling SFT set with mixed tool and no-tool examples.", "max_dataset_bytes": 400000000 }, { "id": "gorilla-llm/Berkeley-Function-Calling-Leaderboard", "slug": "berkeley-function-calling-leaderboard", "category": "tool_calling_eval", "license": "apache-2.0", "purpose": "Holdout function-calling evaluation; do not train on this unless creating synthetic variants.", "max_dataset_bytes": 50000000 }, { "id": "bigcode/self-oss-instruct-sc2-exec-filter-50k", "slug": "self-oss-instruct-sc2-exec-filter-50k", "category": "coding", "license": "odc-by", "purpose": "Coding instruction SFT from SelfCodeAlign.", "max_dataset_bytes": 180000000 }, { "id": "TIGER-Lab/EvolveCoder-22K", "slug": "evolvecoder-22k", "category": "coding", "license": "apache-2.0", "purpose": "Competitive-programming tasks with adversarial/evolved tests.", "max_dataset_bytes": 100000000 }, { "id": "TIGER-Lab/AceCode-V1.1-69K", "slug": "acecode-v1-1-69k", "category": "coding", "license": "mit", "purpose": "Coding problems with tests for code reasoning and verification.", "max_dataset_bytes": 180000000 }, { "id": "TIGER-Lab/WebInstruct-verified", "slug": "webinstruct-verified", "category": "reasoning", "license": "apache-2.0", "purpose": "Verified web-derived reasoning/instruction data, useful as auxiliary SFT.", "max_dataset_bytes": 140000000 }, { "id": "Voxel51/FiftyOne-GUI-Grounding-Train", "slug": "fiftyone-gui-grounding-train", "category": "gui_grounding", "license": "apache-2.0", "purpose": "Small GUI screenshot grounding set for visual UI understanding.", "max_dataset_bytes": 400000000 }, { "id": "Voxel51/FiftyOne-GUI-Grounding-Train-with-Synthetic", "slug": "fiftyone-gui-grounding-train-with-synthetic", "category": "gui_grounding", "license": "apache-2.0", "purpose": "GUI grounding with additional synthetic examples.", "max_dataset_bytes": 600000000 } ], "candidates": [ { "id": "lambda/hermes-agent-reasoning-traces", "category": "agent_traces", "license": "apache-2.0", "size_estimate": "1.62 GB", "reason_not_active": "Excellent match for coding/tool agents, but larger; ingest after first public batch or as a curated subset." }, { "id": "Qwen/WebWorldData", "category": "browser_agent", "license": "apache-2.0", "size_estimate": "52.2 GB", "reason_not_active": "Very relevant for browser-agent world modeling, but should be subsetted before download." }, { "id": "ServiceNow/VideoCUA", "category": "computer_use_video", "license": "mit", "size_estimate": "26.1 GB", "reason_not_active": "Strong computer-use video corpus; download only after deciding frame/action conversion strategy." }, { "id": "ServiceNow/GroundCUA", "category": "computer_use_grounding", "license": "mit", "reason_not_active": "Good computer-use grounding target, but inspect file layout before full sync." }, { "id": "TIGER-Lab/VisualWebInstruct", "category": "multimodal_reasoning", "license": "apache-2.0", "size_estimate": "1M rows", "reason_not_active": "Large multimodal dataset; use a curated sample first." }, { "id": "HuggingFaceM4/Docmatix", "category": "document_vqa", "license": "mit", "size_estimate": "982 GB", "reason_not_active": "Excellent for document VQA/OCR, but full dataset is too large for first pass." }, { "id": "OpenCoder-LLM/opc-sft-stage1", "category": "coding", "license": "mit", "size_estimate": "5.61 GB", "reason_not_active": "Very strong coding SFT source; use a subset/shards after first medium batch." }, { "id": "Modotte/CodeX-2M-Thinking", "category": "coding_reasoning", "license": "apache-2.0", "size_estimate": "24.4 GB", "reason_not_active": "Large code-thinking corpus; candidate for later sampled pretraining/SFT." } ] } def copy_to_gcs(local_path: Path, gcs_path: str, project: str) -> None: subprocess.run( [GCLOUD, "storage", "cp", str(local_path), gcs_path, "--project", project], check=True, ) The first pass creates route-aware tool-calling SFT, repo coding SFT, continued-pretraining code chunks, eval records, frontend page manifests, and screen-record manifests. { "permissions": { "allow": [ "WebSearch" ] } } { "default_gcs_bucket": "gs://maximoai-models-976606885534", "project": "project-6168b668-98c9-444b-b27", "region": "europe-west1", "policy": { "do_not_use_bucket": "gs://mytabulon-mvp-uploads-976606885534", "private_data_rule": "Never mix training datasets with MyTabulon production uploads. Use only gs://maximoai-models-976606885534 for model data.", "secret_rule": "Redact secrets, OAuth tokens, customer payloads, credentials, and private user content before training." }, "local_private_datasets": [ { "id": "mytabulon_tool_calling_sft", "local_path": "data/processed/sft/mytabulon_tool_calling_sft.jsonl", "gcs_path": "gs://maximoai-models-976606885534/processed/sft/mytabulon_tool_calling_sft.jsonl", "format": "openai-compatible-jsonl", "purpose": "Fine-tune route-aware tool selection and arguments for MyTabulon management tasks.", "storage": "local-and-gcs", "privacy": "source-derived-no-live-user-data" }, { "id": "maximoai_repo_coding_sft", "local_path": "data/processed/sft/maximoai_repo_coding_sft.jsonl", "gcs_path": "gs://maximoai-models-976606885534/processed/sft/maximoai_repo_coding_sft.jsonl", "format": "chat-jsonl", "purpose": "Fine-tune repo navigation and coding-context behavior around MyTabulon, Maximo Syntax, and MaximoAI source.", "storage": "local-and-gcs", "privacy": "source-derived-redacted" }, { "id": "maximoai_code_continued_pretrain", "local_path": "data/processed/pretrain/maximoai_code_continued_pretrain.jsonl", "gcs_path": "gs://maximoai-models-976606885534/processed/pretrain/maximoai_code_continued_pretrain.jsonl", "format": "text-jsonl", "purpose": "Low-cost continued pretraining on MaximoAI/MyTabulon code, architecture, prompts, and docs.", "storage": "local-and-gcs", "privacy": "source-derived-redacted" }, { "id": "mytabulon_tool_calling_eval", "local_path": "data/processed/eval/mytabulon_tool_calling_eval.jsonl", "gcs_path": "gs://maximoai-models-976606885534/eval/mytabulon_tool_calling_eval.jsonl", "format": "eval-jsonl", "purpose": "Regression eval for tool choice, route targeting, and required arguments.", "storage": "local-and-gcs", "privacy": "source-derived-no-live-user-data" }, { "id": "maximo_screen_records_manifest", "local_path": "data/processed/manifests/maximo_screen_records_manifest.jsonl", "gcs_path": "gs://maximoai-models-976606885534/manifests/maximo_screen_records_manifest.jsonl", "format": "manifest-jsonl", "purpose": "Manifest for raw screen-record videos that can be converted to image/video supervision.", "storage": "manifest-local-raw-assets-gcs-when-approved", "privacy": "private-product-demo-media" } ], "public_candidate_datasets": [ { "id": "Team-ACE/ToolACE", "gcs_path": "gs://maximoai-models-976606885534/raw/public/toolace/", "rows_estimate": "10K-100K", "size_estimate": "37.2 MB", "license": "apache-2.0", "purpose": "General function/tool-calling SFT.", "source": "https://huggingface.co/datasets/Team-ACE/ToolACE" }, { "id": "Salesforce/xlam-function-calling-60k", "gcs_path": "gs://maximoai-models-976606885534/raw/public/xlam-function-calling-60k/", "rows_estimate": "60K", "license": "verify before commercial use", "purpose": "General function-calling SFT and API argument generation.", "source": "https://huggingface.co/datasets/Salesforce/xlam-function-calling-60k" }, { "id": "bigcode/self-oss-instruct-sc2-exec-filter-50k", "gcs_path": "gs://maximoai-models-976606885534/raw/public/self-oss-instruct-sc2-exec-filter-50k/", "rows_estimate": "50,467", "size_estimate": "90.1 MB", "license": "odc-by", "purpose": "Coding instruction SFT.", "source": "https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-50k" }, { "id": "m-a-p/CodeFeedback-Filtered-Instruction", "gcs_path": "gs://maximoai-models-976606885534/raw/public/codefeedback-filtered-instruction/", "rows_estimate": "60,735", "license": "verify before commercial use", "purpose": "Coding instruction and feedback SFT.", "source": "https://huggingface.co/datasets/m-a-p/CodeFeedback-Filtered-Instruction" }, { "id": "HuggingFaceM4/Docmatix", "gcs_path": "gs://maximoai-models-976606885534/raw/public/docmatix/", "rows_estimate": "1M-10M", "size_estimate": "982 GB", "license": "mit", "purpose": "Document image VQA/OCR continued multimodal tuning. Use a curated subset first.", "source": "https://huggingface.co/datasets/HuggingFaceM4/Docmatix" } ] , "public_ingested_datasets": [ { "id": "Team-ACE/ToolACE", "gcs_path": "gs://maximoai-models-976606885534/raw/public/toolace/6bda777c88d2/", "bytes_uploaded": 37156608, "license": "apache-2.0", "purpose": "General function/tool-calling SFT." }, { "id": "NousResearch/hermes-function-calling-v1", "gcs_path": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/", "bytes_uploaded": 66776246, "license": "apache-2.0", "purpose": "Function-calling, JSON-mode, and agentic tool traces." }, { "id": "glaiveai/glaive-function-calling-v2", "gcs_path": "gs://maximoai-models-976606885534/raw/public/glaive-function-calling-v2/e7f4b6456019/", "bytes_uploaded": 271190171, "license": "apache-2.0", "purpose": "Broad function-calling SFT with mixed tool/no-tool behavior." }, { "id": "gorilla-llm/Berkeley-Function-Calling-Leaderboard", "gcs_path": "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/", "bytes_uploaded": 11742225, "license": "apache-2.0", "purpose": "Function-calling evaluation suite; keep out of training by default." }, { "id": "bigcode/self-oss-instruct-sc2-exec-filter-50k", "gcs_path": "gs://maximoai-models-976606885534/raw/public/self-oss-instruct-sc2-exec-filter-50k/356bb069eee8/", "bytes_uploaded": 90129198, "license": "odc-by", "purpose": "Coding instruction SFT." }, { "id": "TIGER-Lab/EvolveCoder-22K", "gcs_path": "gs://maximoai-models-976606885534/raw/public/evolvecoder-22k/73fa2c3f56f2/", "bytes_uploaded": 37384124, "license": "apache-2.0", "purpose": "Test-aware coding and problem solving." }, { "id": "TIGER-Lab/AceCode-V1.1-69K", "gcs_path": "gs://maximoai-models-976606885534/raw/public/acecode-v1-1-69k/9d74afc8549d/", "bytes_uploaded": 99160155, "license": "mit", "purpose": "Coding problems with tests and code reasoning." }, { "id": "TIGER-Lab/WebInstruct-verified", "gcs_path": "gs://maximoai-models-976606885534/raw/public/webinstruct-verified/3e8a350b3a93/", "bytes_uploaded": 87756597, "license": "apache-2.0", "purpose": "Verified web-derived reasoning/instruction data." }, { "id": "Voxel51/FiftyOne-GUI-Grounding-Train", "gcs_path": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train/01f6d9935139/", "bytes_uploaded": 2055936, "license": "apache-2.0", "purpose": "GUI screenshot grounding for UI understanding." }, { "id": "Voxel51/FiftyOne-GUI-Grounding-Train-with-Synthetic", "gcs_path": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train-with-synthetic/3deedc5d3667/", "bytes_uploaded": 15766174, "license": "apache-2.0", "purpose": "GUI grounding with synthetic examples." } ] } import json from pathlib import Path if __name__ == "__main__": main() def tool_name(method: str, path: str) -> str: tokens = [] for part in path.strip("/").split("/"): if not part or part == "api": continue if part.startswith(":"): tokens.append(f"by_{part[1:]}") else: tokens.append(part) raw = f"mytabulon_{method.lower()}_{'_'.join(tokens)}" raw = re.sub(r"[^a-zA-Z0-9_]+", "_", raw).strip("_").lower() return raw[:96] # Workflow - When debugging unfamiliar technical issues (e.g., quota errors, platform-specific behavior), do web research to find the actual cause rather than speculating. Confidence: 0.65 - Do not start fresh large downloads (e.g., 5+GB ML models from HuggingFace); user has limited internet data. Resume from existing cache or find alternative approaches. Confidence: 0.80 Use these only as candidates. Confirm the current dataset card/license before commercial training and snapshot the exact revision into GCS. { "files": { "code_pretrain": { "bytes": 39436449, "path": "data/processed/pretrain/maximoai_code_continued_pretrain.jsonl", "rows": 7041, "sha256": "bcb0c6c718c7ad7152658e9297d119c469e71012c82b86e5cf1e0f27f2f59a2e" }, "coding_sft": { "bytes": 719827, "path": "data/processed/sft/maximoai_repo_coding_sft.jsonl", "rows": 300, "sha256": "d277f226e9619e097e5d6f2604d9f9f2f40af978fe32f5cfc652560c1348f298" }, "frontend_pages": { "bytes": 42291, "path": "data/processed/manifests/mytabulon_frontend_pages_manifest.jsonl", "rows": 88, "sha256": "11245497366ac3bc55064990fbeaded23b41e1f09bbad291ccef17281217bb59" }, "screen_records": { "bytes": 32438, "path": "data/processed/manifests/maximo_screen_records_manifest.jsonl", "rows": 61, "sha256": "dd1768ae52ee194be35d748a96a66080a048a169304da11282c23ae2349ce61c" }, "tool_eval": { "bytes": 112584, "path": "data/processed/eval/mytabulon_tool_calling_eval.jsonl", "rows": 120, "sha256": "110175f3e42e769488696f043c71dc7f87c489d0d457993e77f1e9b0cb11ab54" }, "tool_sft": { "bytes": 675982, "path": "data/processed/sft/mytabulon_tool_calling_sft.jsonl", "rows": 491, "sha256": "cc5c0f6efc268fa22f46e33759438cbb63cded1b955cab819b8e5bf54f91659d" }, "tool_specs": { "bytes": 338856, "path": "data/processed/manifests/mytabulon_tool_specs.jsonl", "rows": 491, "sha256": "3e0d33e5dfc14d38748031f918c6350906387a2f7ad3bc9b8bf6457e7308b010" } }, "gcs_bucket": "gs://maximoai-models-976606885534", "gcs_prefixes": { "eval": "gs://maximoai-models-976606885534/eval/", "manifests": "gs://maximoai-models-976606885534/manifests/", "processed": "gs://maximoai-models-976606885534/processed/", "raw": "gs://maximoai-models-976606885534/raw/", "snapshots": "gs://maximoai-models-976606885534/snapshots/" }, "generated_at": "2026-06-09T12:54:53+00:00", "notes": [ "No live MyTabulon user data is included by this builder.", "Secret-looking source lines are redacted before dataset generation.", "The existing MyTabulon upload bucket is intentionally not used." ], "sources": { "maximo-syntax-cli": "/Users/johnsondaniel/Documents/maximo-syntax-cli", "maximoai-ios": "/Users/johnsondaniel/Documents/maximoai", "mytabulon": "/Users/johnsondaniel/Documents/mytabulon" }, "workspace": "/Users/johnsondaniel/Documents/maximoai-models" } _cached_key: Optional[str] = None _cached_at: float = 0.0 _CACHE_TTL = 300.0 log() { echo "[helios] $*"; } Use the model dataset workspace: Never use the product upload bucket for training data: PROJECT="${PROJECT:-project-6168b668-98c9-444b-b27}" REGION="${REGION:-europe-west1}" SECRET_NAME="helios-nano-api-key" SERVICE="helios-nano-api" GCLOUD="${GCLOUD:-/Users/johnsondaniel/google-cloud-sdk/bin/gcloud}" def build_frontend_page_manifest(mytabulon_root: Path) -> list[dict[str, Any]]: app_root = mytabulon_root / "frontend" / "src" / "app" if not app_root.exists(): return [] rows: list[dict[str, Any]] = [] for page in sorted(app_root.rglob("page.tsx")): route = path_to_route(page) rows.append( { "id": f"frontend_page_{sha256_text(route)[:12]}", "dataset": "mytabulon_frontend_pages_manifest", "route": route, "source_file": str(page), "intended_visual_dataset": { "image_gcs_prefix": "gs://maximoai-models-976606885534/raw/mytabulon-ui-screenshots/", "format": "image-text-to-text", "task": "Given a screenshot, identify the MyTabulon page, visible workflow state, and the safest next tool/action.", }, } ) return rows def resolve_url(repo_id: str, revision: str, rfilename: str) -> str: encoded_repo = urllib.parse.quote(repo_id, safe="/") encoded_file = urllib.parse.quote(rfilename, safe="/") return f"https://huggingface.co/datasets/{encoded_repo}/resolve/{revision}/{encoded_file}?download=true" def create_endpoint() -> aiplatform.Endpoint: existing = find_endpoint() if existing is not None: print(f"[vertex] Re-using existing Endpoint: {existing.resource_name}") return existing print(f"[vertex] Creating endpoint {ENDPOINT_DISPLAY}…") return aiplatform.Endpoint.create(display_name=ENDPOINT_DISPLAY) For public tool/coding/vision data candidates, read: _http: Optional[httpx.AsyncClient] = None _key: Optional[str] = None _key_at: float = 0.0 def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description="Build local MaximoAI/MyTabulon training datasets.") parser.add_argument("--mytabulon-root", type=Path, default=DEFAULT_MYTABULON_ROOT) parser.add_argument("--maximo-syntax-root", type=Path, default=DEFAULT_MAXIMO_SYNTAX_ROOT) parser.add_argument("--maximoai-app-root", type=Path, default=DEFAULT_MAXIMOAI_APP_ROOT) parser.add_argument("--screen-records-root", type=Path, default=DEFAULT_SCREEN_RECORDS_ROOT) parser.add_argument("--max-files-per-repo", type=int, default=1600) parser.add_argument("--coding-sft-limit", type=int, default=300) return parser.parse_args() - `data/processed/sft/mytabulon_tool_calling_sft.jsonl`: MyTabulon route-aware tool-calling SFT. - `data/processed/sft/maximoai_repo_coding_sft.jsonl`: repo navigation and coding-context SFT. - `data/processed/pretrain/maximoai_code_continued_pretrain.jsonl`: redacted source-code continued-pretraining chunks. - `data/processed/eval/mytabulon_tool_calling_eval.jsonl`: holdout eval for tool choice and arguments. - `data/processed/manifests/maximo_screen_records_manifest.jsonl`: manifest for visual demo media to curate into image/video supervision. --- name: mytabulon-model-datasets description: Build, inspect, sync, and use the private MaximoAI/MyTabulon model training datasets for Qwen-style continued pretraining, SFT, tool-calling, coding, and multimodal data work. Use when asked about MaximoAI model datasets, MyTabulon tool-calling fine-tuning data, GCS model dataset storage, dataset sizes, dataset manifests, public dataset candidates, or how to access/sync training data without mixing it with MyTabulon production uploads. --- build_model_image() { if [[ "${FORCE_MODEL_BUILD:-0}" != "1" ]] \ && "${GCLOUD}" artifacts docker images describe "${MODEL_IMAGE}" --project "${PROJECT}" >/dev/null 2>&1; then log "Model image already exists: ${MODEL_IMAGE} (set FORCE_MODEL_BUILD=1 to rebuild)." return 0 fi log "Building model image via Cloud Build (downloads ~14GB GGUF + vision projector; ~10-20 min)…" log " base=${BASE_IMAGE}" log " model=${HF_REPO}/${MODEL_FILE}" "${GCLOUD}" builds submit "${DEPLOY_DIR}" \ --project "${PROJECT}" \ --config "${DEPLOY_DIR}/cloudbuild.yaml" \ --substitutions "_IMAGE=${MODEL_IMAGE},_BASE_IMAGE=${BASE_IMAGE},_HF_REPO=${HF_REPO},_MODEL_FILE=${MODEL_FILE},_MMPROJ_FILE=${MMPROJ_FILE}" } { "service": "helios-preview", "served_model_name": "maximo-helios-preview", "description": "Maximo Helios Preview — Qwen3.5-2B (Q4_K_S GGUF, multimodal) served via llama.cpp as an OpenAI-compatible API. Scale-to-zero on Cloud Run CPU.", "model": { "base_model": "Qwen/Qwen3.5-2B", "huggingface_repo": "unsloth/Qwen3.5-2B-GGUF", "model_file": "Qwen3.5-2B-Q4_K_S.gguf", "mmproj_file": "mmproj-BF16.gguf", "license": "apache-2.0", "architecture": "dense, hybrid linear+full attention", "params_total": "~2B", "layers": 24, "kv_heads": 2, "head_dim": 256, "modalities": ["text", "image"], "context_length": 262144, "context_note": "256K = model's trained max (max_position_embeddings=262144), deployed with q8_0 KV + flash-attn and --parallel 1 (single request gets the full 256K). Footprint ~12GB on 32Gi (2 KV heads + 24 layers + hybrid attention make the KV cache tiny: ~6-7GB at 256K). NOTE: this swapped from Gemma 4 26B; some older references may still say Gemma.", "parallel_slots": 1, "sampling_defaults": { "temperature": 1.0, "top_p": 0.95, "top_k": 64 } }, "serving": { "engine": "llama.cpp/llama-server", "openai_base_path": "/v1", "endpoints": ["/v1/models", "/v1/chat/completions", "/v1/completions", "/v1/embeddings"], "tool_calling": true, "vision": true, "jinja": true, "port": 8080, "health_route": "/health" }, "compute": { "active": "cpu", "cpu": { "platform": "cloud_run", "execution_environment": "gen2", "cpu": 8, "memory": "32Gi", "min_instances": 0, "max_instances": 2, "concurrency": 2, "timeout_seconds": 3600, "base_image": "ghcr.io/ggml-org/llama.cpp:server", "expected_tok_per_sec": "~5-15 (memory-bandwidth bound)", "extra_llama_args": ["--threads", "8", "--threads-batch", "8"] }, "gpu": { "platform": "cloud_run", "execution_environment": "gen2", "cpu": 8, "memory": "32Gi", "gpu": 1, "gpu_type": "nvidia-l4", "min_instances": 0, "max_instances": 2, "concurrency": 8, "timeout_seconds": 3600, "base_image": "ghcr.io/ggml-org/llama.cpp:server-cuda", "expected_tok_per_sec": "~40-50", "extra_llama_args": ["--n-gpu-layers", "99"] } }, "auth": { "mode": "api_key", "secret_name": "helios-preview-api-key", "key_prefix": "hlp_", "header": "Authorization", "scheme": "Bearer", "mount_path": "/secrets/api-key" }, "iam": { "service_account": "helios-preview-sa", "secret_accessor_role": "roles/secretmanager.secretAccessor" }, "artifact_registry": { "repo": "helios" } } PROJECT="${PROJECT:-project-6168b668-98c9-444b-b27}" REGION="${REGION:-europe-west1}" GCLOUD="${GCLOUD:-/Users/johnsondaniel/google-cloud-sdk/bin/gcloud}" ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" CONFIG="${ROOT}/configs/helios_nano_preview.json" DEPLOY_DIR="${ROOT}/deploy/helios-nano-preview" def redact_long_secret_candidate(match: re.Match[str]) -> str: value = match.group(1) has_digit = any(char.isdigit() for char in value) has_lower = any(char.islower() for char in value) has_upper = any(char.isupper() for char in value) looks_like_identifier = "_" in value and not has_lower and not has_digit if looks_like_identifier: return value if len(value) >= 40 and has_digit and (has_lower or has_upper): return "[REDACTED_TOKEN]" return value # Taste (Continuously Learned by [CommandCode][cmd]) Use these local private datasets first: COMPUTE="${COMPUTE:-cpu}" # cpu | gpu SERVICE="${SERVICE:-helios-preview}" SERVED_MODEL_NAME="maximo-helios-preview" SERVICE_ACCOUNT="helios-preview-sa" SERVICE_ACCOUNT_EMAIL="${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com" SECRET_NAME="helios-preview-api-key" AR_REPO="helios" AR_HOST="${REGION}-docker.pkg.dev" The generated records are intentionally private/local by default. They contain source-derived tool specs, route-aware SFT examples, source-code pretraining chunks, and manifests for visual screen-record assets. """ Recommended first GCS layout: url() { "${GCLOUD}" run services describe "${SERVICE}" --project "${PROJECT}" --region "${REGION}" --format='value(status.url)' } Runs in the SAME container as llama-server (which listens on 127.0.0.1:8081). This process listens on 0.0.0.0:8080 (the public Cloud Run port) and: def path_to_route(path: Path) -> str: parts = list(path.parts) if "app" not in parts: return "/" app_index = parts.index("app") route_parts = parts[app_index + 1 :] if route_parts[-1] in {"page.tsx", "route.ts"}: route_parts = route_parts[:-1] cleaned = [] for part in route_parts: if part.startswith("(") and part.endswith(")"): continue cleaned.append(part) return "/" + "/".join(cleaned) if __name__ == "__main__": main() # Rebuild the baked model image (after changing quant / mmproj) FORCE_BUILD=1 ./scripts/deploy_helios_preview.sh ``` def infer_user_prompt(method: str, path: str) -> str: nouns = [part for part in path.split("/") if part and not part.startswith(":") and part != "api"] target = " ".join(nouns[-3:]).replace("-", " ") if method == "GET": return f"Show me the {target} for this company." if method == "POST": return f"Create or run the {target} workflow for this company." if method in {"PUT", "PATCH"}: return f"Update the {target} settings for this company." if method == "DELETE": return f"Delete the selected {target} item for this company." return f"Use MyTabulon to manage {target}." main "$@" ```python from openai import OpenAI client = OpenAI(base_url="https:///v1", api_key="hlp_...") r = client.chat.completions.create( model="maximo-helios-preview", messages=[{"role": "user", "content": "Hello"}], ) print(r.choices[0].message.content) ``` # build_chat_json -> JSON body on stdout (mode: chat|tools) build_chat_json() { MODEL="${MODEL}" python3 - "$1" "$2" <<'PY' import json, os, sys mode, prompt = sys.argv[1], sys.argv[2] body = { "model": os.environ["MODEL"], "messages": [{"role": "user", "content": prompt}], "temperature": 1.0, "top_p": 0.95, "max_tokens": 512, } if mode == "tools": body["tools"] = [{ "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather for a city", "parameters": { "type": "object", "properties": {"location": {"type": "string", "description": "City name"}}, "required": ["location"], }, }, }] body["tool_choice"] = "auto" print(json.dumps(body)) PY } echo "Created model dataset bucket: ${BUCKET}" Before training or upload: def _client() -> httpx.AsyncClient: global _http if _http is None: _http = httpx.AsyncClient(base_url=UPSTREAM, timeout=httpx.Timeout(3600.0, connect=30.0)) return _http deploy_service() { # All llama-server flags live in the image entrypoint (entrypoint.sh); config is # passed as env vars (no gcloud --args duplicate-token limit). The injector does # API-key auth + identity injection, so the public port (8080) is the injector. local env_vars env_vars="MODEL_FILE=${MODEL_FILE}|MMPROJ_FILE=${MMPROJ_FILE}|SERVED_NAME=${SERVED_MODEL_NAME}" env_vars+="|CTX_SIZE=${CTX_SIZE}|PARALLEL=${PARALLEL}|API_KEY_FILE=/secrets/api-key" env_vars+="|CACHE_TYPE_K=${CACHE_TYPE_K}|CACHE_TYPE_V=${CACHE_TYPE_V}|INJECT_MODE=${INJECT_MODE}" env_vars+="|THREADS=${THREADS}|THREADS_BATCH=${THREADS_BATCH}|COMPUTE=${COMPUTE}" if [[ -n "${EXTRA_ARGS}" ]]; then env_vars+="|EXTRA_ARGS=${EXTRA_ARGS}" fi Sync processed local datasets and manifests: Read `data/processed/manifests/public_dataset_ingest_manifest.json` for the exact revisions, files, and byte counts. deploy_vllm() { log "Deploying vLLM service ${VLLM_SERVICE} (L4 GPU, min-instances=0, max-instances=2)…" "${GCLOUD}" beta run deploy "${VLLM_SERVICE}" \ --project "${PROJECT}" \ --region "${REGION}" \ --image "${VLLM_IMAGE}" \ --execution-environment gen2 \ --no-allow-unauthenticated \ --cpu "${VLLM_CPU:-8}" \ --memory "${VLLM_MEM:-32Gi}" \ --gpu 1 \ --gpu-type nvidia-l4 \ --no-gpu-zonal-redundancy \ --no-cpu-throttling \ --min-instances 0 \ --max-instances 2 \ --concurrency 8 \ --timeout 600 \ --service-account "${SERVICE_ACCOUNT_EMAIL}" \ --add-volume name=dshm,type=tmpfs,size=8Gi \ --add-volume-mount volume=dshm,mount-path=/dev/shm \ --startup-probe "tcpSocket.port=8080,initialDelaySeconds=240,failureThreshold=30,timeoutSeconds=10,periodSeconds=30" \ --command "vllm" \ --args="serve,WeiboAI/VibeThinker-3B,--served-model-name,maximo-helios-nano-preview,--dtype,bfloat16,--max-model-len,8192,--tensor-parallel-size,1,--gpu-memory-utilization,0.9,--max-num-seqs,32,--enable-prefix-caching,--enable-chunked-prefill,--port,8080,--host,0.0.0.0" \ --set-env-vars "HF_HUB_ENABLE_HF_TRANSFER=1,VLLM_DISABLE_USAGE_STATS=1" \ --labels "app=helios-nano-preview,component=vllm" } @app.api_route( "/v1/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"], ) async def proxy_v1(path: str, request: Request) -> Response: if not _check_key(request): return JSONResponse( {"error": {"type": "invalid_api_key", "message": f"Invalid or missing {SCHEME} API key in {HEADER} header."}}, status_code=401, headers={"WWW-Authenticate": SCHEME}, ) body = await request.body() url = f"{UPSTREAM.rstrip('/')}/v1/{path}" forward_headers = { k: v for k, v in request.headers.items() if k.lower() not in {"host", "authorization", "content-length", "x-forwarded-for", "x-forwarded-proto"} } forward_headers["host"] = UPSTREAM.split("://", 1)[1].split("/", 1)[0] client = _get_http() try: upstream_resp = await client.request( method=request.method, url=url, params=request.query_params, headers=forward_headers, content=body, ) except httpx.HTTPError as e: return JSONResponse( {"error": {"type": "upstream_error", "message": str(e)}}, status_code=502, ) excluded = {"content-encoding", "content-length", "transfer-encoding", "connection"} response_headers = {k: v for k, v in upstream_resp.headers.items() if k.lower() not in excluded} return Response( content=upstream_resp.content, status_code=upstream_resp.status_code, headers=response_headers, media_type=upstream_resp.headers.get("content-type"), ) #!/usr/bin/env bash set -euo pipefail if [[ "${BUCKET}" == "gs://mytabulon-mvp-uploads-976606885534"* ]]; then echo "Refusing to sync training data to the MyTabulon production upload bucket." >&2 exit 1 fi files = { "tool_specs": REPO_ROOT / "data" / "processed" / "manifests" / "mytabulon_tool_specs.jsonl", "tool_sft": output_root / "sft" / "mytabulon_tool_calling_sft.jsonl", "tool_eval": output_root / "eval" / "mytabulon_tool_calling_eval.jsonl", "code_pretrain": output_root / "pretrain" / "maximoai_code_continued_pretrain.jsonl", "coding_sft": output_root / "sft" / "maximoai_repo_coding_sft.jsonl", "frontend_pages": output_root / "manifests" / "mytabulon_frontend_pages_manifest.jsonl", "screen_records": output_root / "manifests" / "maximo_screen_records_manifest.jsonl", } jsonl_write(files["tool_specs"], tool_specs) jsonl_write(files["tool_sft"], tool_sft) jsonl_write(files["tool_eval"], tool_eval) jsonl_write(files["code_pretrain"], pretrain_rows) jsonl_write(files["coding_sft"], coding_sft) jsonl_write(files["frontend_pages"], frontend_pages) jsonl_write(files["screen_records"], screen_records) require() { command -v "${GCLOUD}" >/dev/null || { echo "gcloud not found at ${GCLOUD}"; exit 1; } [[ -f "${CONFIG}" ]] || { echo "Missing config: ${CONFIG}"; exit 1; } [[ -f "${DEPLOY_DIR}/Dockerfile" ]] || { echo "Missing ${DEPLOY_DIR}/Dockerfile"; exit 1; } [[ -f "${DEPLOY_DIR}/Dockerfile.serve" ]] || { echo "Missing ${DEPLOY_DIR}/Dockerfile.serve"; exit 1; } [[ -f "${DEPLOY_DIR}/cloudbuild.yaml" ]] || { echo "Missing ${DEPLOY_DIR}/cloudbuild.yaml"; exit 1; } [[ -f "${DEPLOY_DIR}/cloudbuild.serve.yaml" ]] || { echo "Missing ${DEPLOY_DIR}/cloudbuild.serve.yaml"; exit 1; } [[ "${COMPUTE}" == "cpu" || "${COMPUTE}" == "gpu" ]] || { echo "COMPUTE must be cpu|gpu"; exit 1; } } def _authorized(request: Request) -> bool: raw = request.headers.get(HEADER, "") parts = raw.split(None, 1) if len(parts) != 2 or parts[0] != SCHEME: return False presented = parts[1].strip() expected = _load_key() if len(presented) != len(expected): return False result = 0 for a, b in zip(presented, expected): result |= ord(a) ^ ord(b) return result == 0 HF_MODEL_ID = CONFIG["model"]["huggingface_repo"] SERVED_NAME = CONFIG["model"]["served_model_name"] CODE_EXTENSIONS = { ".css", ".html", ".js", ".json", ".jsonc", ".md", ".mjs", ".py", ".sql", ".swift", ".ts", ".tsx", ".yaml", ".yml", } VISUAL_EXTENSIONS = {".png", ".jpg", ".jpeg", ".webp", ".mp4", ".mov"} EXCLUDED_DIRS = { ".DS_Store", ".git", ".next", ".turbo", "build", "coverage", "dist", "node_modules", "tmp", "uploads", } EXCLUDED_FILENAMES = { ".env", ".env.local", ".env.production", "package-lock.json", "bun.lock", "yarn.lock", } SECRET_PATTERN = re.compile( r"(api[_-]?key|secret|token|password|private[_-]?key|client[_-]?secret|bearer\s+|authorization)", re.IGNORECASE, ) LONG_SECRET_PATTERN = re.compile(r"([A-Za-z0-9_\-]{32,})") INFRA_PATTERN = re.compile( r"(project-[a-f0-9-]{20,}|mytabulon-mvp-uploads-\d+|maximoai-models-\d+|\b(?:10|34)\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)", re.IGNORECASE, ) SERVICE_ACCOUNT="helios-nano-sa" SERVICE_ACCOUNT_EMAIL="${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com" SECRET_NAME="helios-nano-api-key" AR_REPO="helios" VLLM_SERVICE="helios-nano-vllm" API_SERVICE="helios-nano-api" VLLM_IMAGE="us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-vllm-serve:latest" AR_HOST="${REGION}-docker.pkg.dev" IMAGE_TAG="${AR_HOST}/${PROJECT}/${AR_REPO}/helios-nano-auth:${RANDOM:-$$}" Treat any match as a blocker unless it is a known placeholder or redaction token. Approved public ingest: ## Validation import httpx from fastapi import FastAPI, Request, Response from fastapi.responses import JSONResponse from google.cloud import secretmanager ## GCS Workflow def download_file(url: str, dest: Path, max_bytes: int) -> int: dest.parent.mkdir(parents=True, exist_ok=True) tmp = dest.with_suffix(dest.suffix + ".part") req = urllib.request.Request(url, headers={"User-Agent": "maximoai-dataset-ingest/1.0"}) downloaded = 0 with urllib.request.urlopen(req, timeout=120) as response, tmp.open("wb") as handle: content_length = response.headers.get("Content-Length") if content_length and int(content_length) > max_bytes: tmp.unlink(missing_ok=True) raise ValueError(f"remote file exceeds byte cap: {dest} ({content_length} > {max_bytes})") while True: chunk = response.read(1024 * 1024) if not chunk: break downloaded += len(chunk) if downloaded > max_bytes: tmp.unlink(missing_ok=True) raise ValueError(f"download exceeded byte cap: {dest}") handle.write(chunk) tmp.replace(dest) return downloaded ensure_service_account() { if "${GCLOUD}" iam service-accounts describe "${SERVICE_ACCOUNT_EMAIL}" --project "${PROJECT}" >/dev/null 2>&1; then log "Service account exists: ${SERVICE_ACCOUNT_EMAIL}" else log "Creating service account: ${SERVICE_ACCOUNT_EMAIL}" "${GCLOUD}" iam service-accounts create "${SERVICE_ACCOUNT}" \ --project "${PROJECT}" \ --display-name="Helios Preview Service Account" >/dev/null fi # Newly-created service accounts take a few seconds to propagate to IAM, so the # role binding can fail with "does not exist" right after creation. Retry. log "Granting secretmanager.secretAccessor (retrying for IAM propagation)…" local attempt for attempt in 1 2 3 4 5 6; do if "${GCLOUD}" projects add-iam-policy-binding "${PROJECT}" \ --member="serviceAccount:${SERVICE_ACCOUNT_EMAIL}" \ --role="roles/secretmanager.secretAccessor" --condition=None >/dev/null 2>&1; then log " secretAccessor bound (attempt ${attempt})." return 0 fi log " attempt ${attempt} failed (SA not propagated yet); sleeping 10s…" sleep 10 done echo "Failed to bind secretAccessor after retries." >&2 return 1 } def load_config(path: Path) -> dict[str, Any]: config = json.loads(path.read_text(encoding="utf-8")) bucket = config["bucket"] if bucket.startswith(DO_NOT_USE_BUCKET): raise ValueError("Refusing to use the MyTabulon product upload bucket for training data.") return config _sm_client: Optional[secretmanager.SecretManagerServiceClient] = None _http: Optional[httpx.AsyncClient] = None REPO_ROOT = Path(__file__).resolve().parents[1] DEFAULT_MYTABULON_ROOT = Path("/Users/johnsondaniel/Documents/mytabulon") DEFAULT_MAXIMO_SYNTAX_ROOT = Path("/Users/johnsondaniel/Documents/maximo-syntax-cli") DEFAULT_MAXIMOAI_APP_ROOT = Path("/Users/johnsondaniel/Documents/maximoai") DEFAULT_SCREEN_RECORDS_ROOT = Path("/Users/johnsondaniel/Documents/Maximo AI Screen Records") ```text gs://maximoai-models-976606885534/raw/public/toolace/ gs://maximoai-models-976606885534/raw/public/xlam-function-calling-60k/ gs://maximoai-models-976606885534/raw/public/self-oss-instruct-sc2-exec-filter-50k/ gs://maximoai-models-976606885534/raw/public/codefeedback-filtered-instruction/ gs://maximoai-models-976606885534/raw/public/docmatix/subset/ ``` "${GCLOUD}" storage cp "${ROOT}/data/catalogs/dataset_registry.json" "${BUCKET}/manifests/dataset_registry.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/configs/storage.json" "${BUCKET}/manifests/configs/storage.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/configs/public_dataset_ingest.json" "${BUCKET}/manifests/configs/public_dataset_ingest.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/configs/mixes/qwen35_4b_first_sft_mix.json" "${BUCKET}/manifests/configs/mixes/qwen35_4b_first_sft_mix.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/configs/mixes/qwen35_4b_continued_pretrain_mix.json" "${BUCKET}/manifests/configs/mixes/qwen35_4b_continued_pretrain_mix.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/configs/mixes/qwen35_4b_public_augmented_sft_mix.json" "${BUCKET}/manifests/configs/mixes/qwen35_4b_public_augmented_sft_mix.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/manifests/dataset_manifest.json" "${BUCKET}/manifests/dataset_manifest.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/manifests/public_dataset_ingest_manifest.json" "${BUCKET}/manifests/public_dataset_ingest_manifest.json" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/manifests/mytabulon_tool_specs.jsonl" "${BUCKET}/manifests/mytabulon_tool_specs.jsonl" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/manifests/mytabulon_frontend_pages_manifest.jsonl" "${BUCKET}/manifests/mytabulon_frontend_pages_manifest.jsonl" --project "${PROJECT}" "${GCLOUD}" storage cp "${ROOT}/data/processed/manifests/maximo_screen_records_manifest.jsonl" "${BUCKET}/manifests/maximo_screen_records_manifest.jsonl" --project "${PROJECT}" case "${1:-chat}" in models) curl -sS "${api_url}/v1/models" \ -H "Authorization: Bearer ${api_key}" | python3 -m json.tool ;; chat) prompt="${2:-What is 17 * 23?}" body=$(python3 -c "import json,sys; print(json.dumps({'model':'maximo-helios-nano-preview','messages':[{'role':'user','content':sys.argv[1]}],'temperature':1.0,'top_p':0.95,'max_tokens':512}))" "${prompt}") curl -sS "${api_url}/v1/chat/completions" \ -H "Authorization: Bearer ${api_key}" \ -H "Content-Type: application/json" \ -d "${body}" | python3 -m json.tool ;; *) echo "usage: $0 {models|chat \"prompt\"|stream \"prompt\"}" >&2 exit 1 ;; esac PROJECT="${PROJECT:-project-6168b668-98c9-444b-b27}" REGION="${REGION:-europe-west1}" BUCKET="${BUCKET:-gs://maximoai-models-976606885534}" GCLOUD="${GCLOUD:-/Users/johnsondaniel/google-cloud-sdk/bin/gcloud}" # If either process exits, shut the container down so Cloud Run restarts it. trap 'kill ${LLAMA_PID} ${INJ_PID} 2>/dev/null || true' EXIT wait -n ${LLAMA_PID} ${INJ_PID} echo "[entrypoint] a child process exited; stopping container." exit 1 print_summary() { local api_url api_url="$("${GCLOUD}" run services describe "${SERVICE}" --project "${PROJECT}" --region "${REGION}" --format='value(status.url)')" echo echo "============================================================" echo " maximo helios preview — DEPLOYED" echo "============================================================" echo " Endpoint URL : ${api_url}" echo " Served model : ${SERVED_MODEL_NAME}" echo " Base model : Qwen3.5-2B (Q4_K_S GGUF, multimodal, 256K ctx)" echo " Region : ${REGION}" echo " Compute : ${COMPUTE} (scales to zero when idle)" echo " Capabilities : OpenAI /v1 · tool calling · vision" echo " Auth : Authorization: Bearer " echo " Secret name : ${SECRET_NAME} (Secret Manager)" echo echo " Get the key : ./scripts/invoke_helios_preview.sh key" echo " Smoke test : ./scripts/invoke_helios_preview.sh chat \"Say hi in 5 words\"" echo echo " OpenAI SDK:" echo " from openai import OpenAI" echo " client = OpenAI(base_url='${api_url}/v1', api_key='')" echo " r = client.chat.completions.create(" echo " model='${SERVED_MODEL_NAME}'," echo " messages=[{'role':'user','content':'Hello'}])" echo echo " NOTE: first request after idle is a cold start (~60-120s on CPU" echo " while the model loads). Subsequent requests are warm." echo "============================================================" } UPSTREAM = os.environ.get("UPSTREAM_URL", "http://127.0.0.1:8081") API_KEY_FILE = os.environ.get("API_KEY_FILE", "/secrets/api-key") INJECT = os.environ.get("INJECT_IDENTITY", "1") == "1" # "user_prefix" (template-agnostic, safe) or "system" (uses a system message). INJECT_MODE = os.environ.get("INJECT_MODE", "user_prefix") IDENTITY = os.environ.get( "IDENTITY_SYSTEM_PROMPT", "You are Maximo Helios Preview, a large language model built by Maximo AI Ltd. " "When asked who you are, your name, or who created, made or trained you, you are " "Maximo Helios Preview by Maximo AI Ltd. " "Never identify yourself as Gemma, Google, Qwen, Alibaba, or any other model or company.", ) HEADER = "Authorization" SCHEME = "Bearer" # Two images: MODEL_IMAGE bakes the model weights (built once per model); SERVE_IMAGE # layers the identity injector + entrypoint on top. MODEL_SANITY="$(echo "${MODEL_FILE}" | sed 's/\.gguf//g' | tr '[:upper:]' '[:lower:]' | tr '_' '-')" MODEL_IMAGE="${AR_HOST}/${PROJECT}/${AR_REPO}/helios-preview-${MODEL_SANITY}-${COMPUTE}:latest" SERVE_IMAGE="${AR_HOST}/${PROJECT}/${AR_REPO}/helios-preview-serve-${MODEL_SANITY}-${COMPUTE}:latest" app = FastAPI(title="maximo-helios-preview-injector") ensure_service_account() { if "${GCLOUD}" iam service-accounts describe "${SERVICE_ACCOUNT_EMAIL}" --project "${PROJECT}" >/dev/null 2>&1; then log "Service account exists: ${SERVICE_ACCOUNT_EMAIL}" else log "Creating service account: ${SERVICE_ACCOUNT_EMAIL}" "${GCLOUD}" iam service-accounts create "${SERVICE_ACCOUNT}" \ --project "${PROJECT}" \ --display-name="Helios Nano Preview Service Account" >/dev/null fi log "Granting secretmanager.secretAccessor…" "${GCLOUD}" projects add-iam-policy-binding "${PROJECT}" \ --member="serviceAccount:${SERVICE_ACCOUNT_EMAIL}" \ --role="roles/secretmanager.secretAccessor" >/dev/null } set -euo pipefail ```text gs://mytabulon-mvp-uploads-976606885534/ ``` { "name": "qwen35_4b_public_augmented_sft_mix", "base_model": "Qwen/Qwen3.5-4B-Base", "goal": "Expanded SFT mix for a MyTabulon manager/coding agent with strong tool-calling and coding behavior.", "storage_bucket": "gs://maximoai-models-976606885534", "datasets": [ { "id": "mytabulon_tool_calling_sft", "path": "gs://maximoai-models-976606885534/processed/sft/mytabulon_tool_calling_sft.jsonl", "weight": 0.30, "role": "core-private-tool-calling" }, { "id": "maximoai_repo_coding_sft", "path": "gs://maximoai-models-976606885534/processed/sft/maximoai_repo_coding_sft.jsonl", "weight": 0.10, "role": "core-private-coding" }, { "id": "Team-ACE/ToolACE", "path": "gs://maximoai-models-976606885534/raw/public/toolace/6bda777c88d2/", "weight": 0.10, "role": "public-tool-calling" }, { "id": "NousResearch/hermes-function-calling-v1", "path": "gs://maximoai-models-976606885534/raw/public/hermes-function-calling-v1/dae3e1d28cfb/", "weight": 0.12, "role": "public-tool-calling-json-mode" }, { "id": "glaiveai/glaive-function-calling-v2", "path": "gs://maximoai-models-976606885534/raw/public/glaive-function-calling-v2/e7f4b6456019/", "weight": 0.12, "role": "public-tool-calling-broad" }, { "id": "bigcode/self-oss-instruct-sc2-exec-filter-50k", "path": "gs://maximoai-models-976606885534/raw/public/self-oss-instruct-sc2-exec-filter-50k/356bb069eee8/", "weight": 0.08, "role": "public-coding" }, { "id": "TIGER-Lab/EvolveCoder-22K", "path": "gs://maximoai-models-976606885534/raw/public/evolvecoder-22k/73fa2c3f56f2/", "weight": 0.06, "role": "public-test-aware-coding" }, { "id": "TIGER-Lab/AceCode-V1.1-69K", "path": "gs://maximoai-models-976606885534/raw/public/acecode-v1-1-69k/9d74afc8549d/", "weight": 0.06, "role": "public-code-reasoning" }, { "id": "TIGER-Lab/WebInstruct-verified", "path": "gs://maximoai-models-976606885534/raw/public/webinstruct-verified/3e8a350b3a93/", "weight": 0.04, "role": "public-reasoning" }, { "id": "Voxel51/FiftyOne-GUI-Grounding-Train-with-Synthetic", "path": "gs://maximoai-models-976606885534/raw/public/fiftyone-gui-grounding-train-with-synthetic/3deedc5d3667/", "weight": 0.02, "role": "public-gui-grounding" } ], "holdout_eval": [ "gs://maximoai-models-976606885534/eval/mytabulon_tool_calling_eval.jsonl", "gs://maximoai-models-976606885534/raw/public/berkeley-function-calling-leaderboard/61fc0608cfd8/" ], "notes": [ "Keep private MyTabulon tool-calling records overweighted so public generic tools do not wash out product behavior.", "Treat BFCL as eval by default.", "Convert public source formats into the final Qwen chat/tool-call template before training.", "Use LoRA/QLoRA first; do not full fine-tune until evals improve." ] } Local workspace: import json from pathlib import Path log() { echo "[helios-preview] $*"; } The sync script refuses to use the MyTabulon upload bucket. If a command mentions `mytabulon-mvp-uploads-976606885534`, stop and correct it. @app.get("/") async def root(): return {"service": "maximo-helios-preview", "openai_compatible": True, "endpoints": ["/v1/models", "/v1/chat/completions", "/v1/completions"]} { "project": "project-6168b668-98c9-444b-b27", "region": "europe-west1", "model_bucket": "gs://maximoai-models-976606885534", "do_not_use_for_training": [ "gs://mytabulon-mvp-uploads-976606885534" ], "prefixes": { "raw": "raw/", "processed": "processed/", "eval": "eval/", "manifests": "manifests/", "snapshots": "snapshots/", "runs": "runs/" } } log "Deploying ${SERVICE} (compute=${COMPUTE}, ctx=${CTX_SIZE}, min-instances=0, max=${MAX_INSTANCES})…" "${GCLOUD}" beta run deploy "${SERVICE}" "${flags[@]}" } PROJECT = os.environ.get("PROJECT", "project-6168b668-98c9-444b-b27") REGION = os.environ.get("REGION", CONFIG["compute"]["region"]) os.environ.setdefault("GOOGLE_CLOUD_REGION", REGION) SERVICE_ACCOUNT = f"{CONFIG['iam']['service_account']}@{PROJECT}.iam.gserviceaccount.com" """API-key auth proxy in front of the vLLM OpenAI-compatible server. ```text /Users/johnsondaniel/Documents/maximoai-models/ configs/ data/ catalogs/ processed/ pretrain/ sft/ eval/ manifests/ scripts/ skills/ ``` enable_apis() { log "Enabling required APIs (idempotent)…" "${GCLOUD}" services enable \ run.googleapis.com \ cloudbuild.googleapis.com \ artifactregistry.googleapis.com \ secretmanager.googleapis.com \ --project "${PROJECT}" >/dev/null } def upload_model() -> aiplatform.Model: existing = find_model() if existing is not None: print(f"[vertex] Re-using existing Model: {existing.resource_name}") return existing print(f"[vertex] Uploading model {MODEL_DISPLAY} from {VLLM_IMAGE}…") return aiplatform.Model.upload( display_name=MODEL_DISPLAY, serving_container_image_uri=VLLM_IMAGE, serving_container_args=vllm_args(), serving_container_ports=[CONFIG["vllm"]["port"]], serving_container_predict_route=CONFIG["vllm"]["predict_route"], serving_container_health_route=CONFIG["vllm"]["health_route"], serving_container_shared_memory_size_mb=CONFIG["vllm"]["shared_memory_mb"], serving_container_deployment_timeout=CONFIG["compute"]["timeout_seconds"], serving_container_environment_variables={ "MODEL_ID": HF_MODEL_ID, "DEPLOY_SOURCE": "helios-nano-preview-deploy-script", "HF_HUB_ENABLE_HF_TRANSFER": "1", "VLLM_DISABLE_USAGE_STATS": "1", }, ) if INJECT_MODE == "system": for m in msgs: if m.get("role") == "system": m["content"] = IDENTITY + "\n\n" + (m.get("content") or "") break else: msgs.insert(0, {"role": "system", "content": IDENTITY}) else: # user_prefix — template-agnostic, safe for any Gemma template for m in msgs: if m.get("role") == "user": c = m.get("content") if isinstance(c, str): m["content"] = IDENTITY + "\n\n" + c elif isinstance(c, list): # multimodal content parts c.insert(0, {"type": "text", "text": IDENTITY}) break REPO_ROOT = Path(__file__).resolve().parents[1] DEFAULT_CONFIG = REPO_ROOT / "configs" / "public_dataset_ingest.json" GCLOUD = "/Users/johnsondaniel/google-cloud-sdk/bin/gcloud" SAFE_EXTENSIONS = { ".arrow", ".csv", ".gz", ".json", ".jsonl", ".md", ".parquet", ".txt", ".yaml", ".yml", ".zip" } SKIP_NAMES = {".gitattributes"} DO_NOT_USE_BUCKET = "gs://mytabulon-mvp-uploads-976606885534" @app.get("/health") async def health(): try: r = await _client().get("/health", timeout=10.0) return JSONResponse({"status": "ok"} if r.status_code == 200 else {"status": "starting"}, status_code=200 if r.status_code == 200 else 503) except Exception as e: # noqa: BLE001 return JSONResponse({"status": "starting", "error": str(e)}, status_code=503) def sha256_file(path: Path) -> str: digest = hashlib.sha256() with path.open("rb") as handle: for chunk in iter(lambda: handle.read(1024 * 1024), b""): digest.update(chunk) return digest.hexdigest() if stream: req = client.build_request(request.method, url, params=request.query_params, headers=fwd, content=body) resp = await client.send(req, stream=True) headers = {k: v for k, v in resp.headers.items() if k.lower() not in drop} async def keep_alive_generator(r): import asyncio queue = asyncio.Queue() loop = asyncio.get_running_loop() async def read_upstream(): try: async for chunk in r.aiter_bytes(): await queue.put(chunk) await queue.put(None) # EOF sentinel except Exception as e: await queue.put(e) read_task = loop.create_task(read_upstream()) try: while True: try: item = await asyncio.wait_for(queue.get(), timeout=10.0) if item is None: break if isinstance(item, Exception): raise item yield item except asyncio.TimeoutError: yield b": ping\n\n" finally: if not read_task.done(): read_task.cancel() try: await read_task except asyncio.CancelledError: pass await r.aclose() return StreamingResponse(keep_alive_generator(resp), status_code=resp.status_code, headers=headers, media_type=resp.headers.get("content-type")) try: resp = await client.request(request.method, url, params=request.query_params, headers=fwd, content=body) except httpx.HTTPError as e: return JSONResponse({"error": {"type": "upstream_error", "message": str(e)}}, status_code=502) headers = {k: v for k, v in resp.headers.items() if k.lower() not in drop} return Response(content=resp.content, status_code=resp.status_code, headers=headers, media_type=resp.headers.get("content-type")) def now_iso() -> str: return datetime.now(timezone.utc).isoformat(timespec="seconds") VLLM_IMAGE = CONFIG["vllm"]["image"] MAX_MODEL_LEN = CONFIG["model"]["max_model_len"] DTYPE = CONFIG["model"]["dtype"] TP = CONFIG["model"]["tensor_parallel_size"] GPU_MEM_UTIL = CONFIG["model"]["gpu_memory_utilization"] MAX_NUM_SEQS = CONFIG["model"]["max_num_seqs"] fwd = {k: v for k, v in request.headers.items() if k.lower() not in {"host", "authorization", "content-length"}} client = _client() url = f"/v1/{path}" drop = {"content-length", "transfer-encoding", "connection", "content-encoding"} def infer_description(method: str, path: str) -> str: clean = path.replace(":companyId", "company").replace("/", " ").strip() verbs = { "GET": "Read or list", "POST": "Create, run, or submit", "PUT": "Replace or update", "PATCH": "Patch or partially update", "DELETE": "Delete", } return f"{verbs.get(method, method)} MyTabulon {clean} records." - **CPU speed:** ~5-15 tok/s (memory-bandwidth bound) for a 4B-active MoE at Q4. Great for tool calling / agentic JSON / short answers; slow for long prose and heavy vision. Flip to `COMPUTE=gpu` if you need ~40-50 tok/s. - **Cold start:** first request after idle is ~60-120s on CPU while the model loads. Set `--min-instances 1` if you need it always-warm (costs money). - **Tool calling** uses `--jinja` with the model's embedded chat template. If a future Gemma 4 GGUF needs a corrected tool template, add `--chat-template-file` to the args in `deploy_helios_preview.sh`. - **KV cache is left at full precision** on purpose — quantizing it degrades tool calling. - **Rebranding only** today (served as `maximo-helios-preview`). To make it truly *yours*, LoRA-fine-tune Gemma 4 on the datasets in this repo (`scripts/build_mytabulon_datasets.py`), convert to GGUF, and point `MODEL_FILE` at the result. def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description="Download approved public datasets and sync to GCS.") parser.add_argument("--config", type=Path, default=DEFAULT_CONFIG) parser.add_argument("--only", action="append", default=[], help="Limit to one or more dataset slugs or IDs.") parser.add_argument("--dry-run", action="store_true") return parser.parse_args() ## Deploy def join_routes(mount: str, child: str) -> str: if child == "/": return mount return f"{mount.rstrip('/')}/{child.lstrip('/')}" def build_tool_datasets(mytabulon_root: Path) -> tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]]]: index_path = mytabulon_root / "backend" / "src" / "index.ts" specs: list[dict[str, Any]] = [] sft_rows: list[dict[str, Any]] = [] eval_rows: list[dict[str, Any]] = [] for mount in parse_route_mounts(index_path): for method, child in parse_router_routes(mount.route_file): path = join_routes(mount.mount, child) name = tool_name(method, path) schema = infer_properties(method, path) spec = { "name": name, "description": infer_description(method, path), "method": method, "path_template": path, "parameters": schema, "source_file": str(mount.route_file), "router": mount.router_name, } specs.append(spec) args = tool_arguments(method, path) tools = [ { "type": "function", "function": { "name": name, "description": spec["description"], "parameters": schema, }, } ] sft_rows.append( { "id": f"tool_sft_{sha256_text(method + path)[:12]}", "dataset": "mytabulon_tool_calling_sft", "messages": [ { "role": "system", "content": ( "You are MaximoAI inside MyTabulon. Choose the narrowest safe " "tool call for the user's business-management request. Do not " "invent tools or secrets." ), }, {"role": "user", "content": infer_user_prompt(method, path)}, { "role": "assistant", "content": "", "tool_calls": [ { "type": "function", "function": {"name": name, "arguments": args}, } ], }, ], "tools": tools, "metadata": { "method": method, "path_template": path, "source_file": str(mount.route_file), "privacy": "source-derived-no-live-user-data", }, } ) if len(eval_rows) < 120: eval_rows.append( { "id": f"tool_eval_{sha256_text(method + path)[:12]}", "dataset": "mytabulon_tool_calling_eval", "user": infer_user_prompt(method, path), "tools": tools, "expected_tool_name": name, "expected_arguments_subset": { param: args[param] for param in route_params(path) if param in args }, "metadata": {"method": method, "path_template": path}, } ) specs.sort(key=lambda row: (row["path_template"], row["method"])) sft_rows.sort(key=lambda row: row["id"]) eval_rows.sort(key=lambda row: row["id"]) return specs, sft_rows, eval_rows | File | Purpose | |---|---| | `Dockerfile` | Two-stage build: download GGUF from HF, bake into `llama.cpp:server` image | | `cloudbuild.yaml` | In-cloud build (120 GB disk, 60-min timeout) | | `../../configs/helios_preview.json` | Source-of-truth config (model, compute, auth) | | `../../scripts/deploy_helios_preview.sh` | Idempotent deploy | | `../../scripts/invoke_helios_preview.sh` | Smoke tests | def _load_key() -> str: global _key, _key_at now = time.time() if _key is not None and (now - _key_at) < 300: return _key with open(API_KEY_FILE, "r", encoding="utf-8") as fh: _key = fh.read().strip() _key_at = now return _key cmd="${1:-chat}" case "${cmd}" in key) key ;; url) url ;; models) curl -sS --max-time 180 "$(url)/v1/models" \ -H "Authorization: Bearer $(key)" | python3 -m json.tool ;; chat) post_chat "$(build_chat_json chat "${2:-Say hello in exactly five words.}")" ;; tools) post_chat "$(build_chat_json tools "${2:-What is the weather in Lagos right now?}")" ;; *) echo "usage: $0 {key|url|models|chat \"prompt\"|tools \"prompt\"}" >&2 exit 1 ;; esac ```bash bash scripts/sync_datasets_to_gcs.sh ``` stream = False if body: try: stream = bool(json.loads(body).get("stream")) except Exception: stream = False grant_api_to_vllm_invoker() { log "Granting ${SERVICE_ACCOUNT_EMAIL} invoker on ${VLLM_SERVICE}…" "${GCLOUD}" run services add-iam-policy-binding "${VLLM_SERVICE}" \ --project "${PROJECT}" \ --region "${REGION}" \ --member="serviceAccount:${SERVICE_ACCOUNT_EMAIL}" \ --role="roles/run.invoker" >/dev/null } MODEL_FILE="${MODEL_FILE:-Qwen3.5-2B-Q4_K_S.gguf}" MMPROJ_FILE="${MMPROJ_FILE:-mmproj-BF16.gguf}" SERVED_NAME="${SERVED_NAME:-maximo-helios-preview}" CTX_SIZE="${CTX_SIZE:-262144}" # 256K = model's trained max (deploy passes this explicitly) PARALLEL="${PARALLEL:-1}" CACHE_TYPE_K="${CACHE_TYPE_K:-f16}" # f16 default. Set q8_0 (auto-enables flash-attn) to push toward 256K. CACHE_TYPE_V="${CACHE_TYPE_V:-f16}" THREADS="${THREADS:-8}" THREADS_BATCH="${THREADS_BATCH:-8}" EXTRA_ARGS="${EXTRA_ARGS:-}" # e.g. "--n-gpu-layers 99" for the GPU build # Public Dataset Candidates # L4 GPU instead (faster, ~40-50 tok/s; also scales to zero) COMPUTE=gpu ./scripts/deploy_helios_preview.sh data["messages"] = msgs return json.dumps(data).encode("utf-8") def sha256_text(value: str) -> str: return hashlib.sha256(value.encode("utf-8")).hexdigest() UPSTREAM = os.environ["UPSTREAM_URL"] SECRET_RESOURCE = os.environ["SECRET_RESOURCE"] HEADER = os.environ.get("AUTH_HEADER", "Authorization") SCHEME = os.environ.get("AUTH_SCHEME", "Bearer") def human_bytes(value: int) -> str: size = float(value) for unit in ["B", "KB", "MB", "GB", "TB"]: if size < 1024 or unit == "TB": return f"{size:.1f} {unit}" size /= 1024 return f"{size:.1f} TB"