""" xc_validation_strategy_vllm_zhouyuanxi — 主入口 启动后针对 4 张 GPU 卡(MetaX_c-500 / Kunlunxin_p-800 / Biren_166m / Cambricon_mlu-370-x8)分别批量提交各自筛选出的模型适配任务 (/api/adapt/task/add,xc-Token 认证)。 提交账号采用自动 fallback 轮转:按 ACCOUNTS 列表顺序提交,一旦当前账号命中 平台的"异步验证任务数量已达上限(100)"限制(错误码 60007),自动切换到下一个 账号继续提交同一个模型,直至全部账号额度用尽。 之后保持 HTTP 服务存活,暴露 /health(K8s 探活)和 /status(运行状态)。 """ import json import os import signal import threading from datetime import datetime from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from typing import List, Tuple import requests # ══════════════════════════════════════════════════════════ # 配置 # ══════════════════════════════════════════════════════════ BASE_URL = os.environ.get("BASE_URL", "https://modelhub.org.cn") ADD_TASK_ENDPOINT = "/api/adapt/task/add" TASK_TYPE = "text-generation" STRATEGY_ID = os.environ.get("STRATEGY_ID", "") # 平台自动注入,无需修改 HTTP_HOST = "0.0.0.0" HTTP_PORT = 8080 # 提交账号(按优先级排列,前一个额度满了自动切换到下一个) ACCOUNTS: List[Tuple[str, str, str]] = [ ("zhouyuanxi", "i-zhouyuanxi@4paradigm.com", "62b9b487eff2488fb9f1da0b963f0b93"), ("jiajing", "jiajing", "5e051e0ff8384a81af53bea780deb28a"), ("fanyi", "fanyi", "f2d501c9ae6543a589cd6cb789108c41"), ("miaoyao", "miaoyao", "77033cee0fb549598cdd590be0d02983"), ("zhoukaile", "zhoukaile", "bd7c52f3b9604ef48a14dd6174513935"), ("fanyi2", "fanyi2", "2586efe06c0a42fda060d5eca34bf766"), ("l112233", "l112233", "40cb6910dc9a442a816298a228da65ac"), ("l11223344", "l11223344", "e1c0db2959e5411f9342c8550b03f6e9"), ("keii", "keii", "be99003a85f640d8978823a5a8e3f297"), ("zhangyuanxi", "zhangyuanxi", "24ed39f7f0d84fafbe0ca808e62b191c"), ("jiangxiaowen", "jiangxiaowen", "88d5fee9f1fe4f7583f11a9d3702dc85"), ] # ══════════════════════════════════════════════════════════ # 各 GPU 的模型列表(来自 filter_verified_models 脚本的筛选结果) # ══════════════════════════════════════════════════════════ METAX_MODELS = [ "EphemeralYou/Prompt-Refine-MiniCPM5-1B", "NousResearch/Hermes-4-14B", "ToxicityPrompts/PolyGuard-Ministral", "Adithyaaaa/chemistry-mistral-7b-v0.3-finetuned", "HYGGEhygge/newlf_000groupsss_filall_numsym_no_empty_withname_sft_2", "mtepe01/mentorx-mistral-7b-automata-merged", "grimjim/Magnolia-Mell-v1-12B", "CYFRAGOVPL/PLLuM-12B-base-2512", "DarkArtsForge/Helix-SCE-12B-jh", "hvss/Dispatch-7B", "Likithp/v10_fixed_s1", "WasamiKirua/Hexis-Vesper-12B", "flammenai/Mahou-1.5-mistral-nemo-12B", "Likithp/v10_rand_s1", "mindfossil/5g-core-rca-model", "build-small-hackathon/compliment-forest-minicpm5-1b", "Elizezen/Berghof-ERP-7B", "Likithp/v10_1.5B_fixed_s42", "Mohamed475/qwen3-1.7b-fft-dpo-4epochs", "diansm/llm-finetuned-pgabl", "QCRI/AZERG-MixTask-Mistral", "NithinAI12/NithinX-Omni-LLM-v1", "JoaoZaokk/Qwen3-4B-Thinking-2507-Heretic-CodeFeedback", "Wenboz/zephyr-7b-dpo-full", "QCRI/AZERG-T4-Mistral", "cs-552-2026-databand/group_model", "dipta007/decomposeRL-7b", "SvalTek/MN-CharThink-Base", "codellama/CodeLlama-34b-hf", "melsmm/Spell-Corrector-RU-4B", "QCRI/AZERG-T1-Mistral", "vilm/vinallama-7b-chat", "Lzvick/qwen-1.7b-math-reasoner-grpo", "kosiasuzu/agenticml-agent-llama-3.1-8b-init", "Lipas007/iol-ai-2026-qwen14b-awq", "vclmax/nemo-12b-expansion-v1", "jithinjames/iol-ai-2026-solver", "Vortex5/Silver-Siren-12B", "ArliAI/Mistral-Nemo-12B-ArliAI-RPMax-v1.2", "kosiasuzu/chatml-agent-llama-3.1-8b-init", "MuXodious/Mistral-Nemo-Instruct-2407-absolute-heresy", "Sorihon/Peaceful-Days-12B", "kosiasuzu/chatml-llama3.1-8b-lora-merged", "simonts/genre2-grm-sft", "ewald1976/Silver-Siren-ST-12B", "D-Z-W/finetuned-teacher", "hxia7/qwen3-4b-blockdist", "ewald1976/MeterMaid-12b", "build-small-hackathon/deal_sft_lora_4B", "HamnaKaleem/IOL-AI-2026", "Retreatcost/KansenSakura-Erosion-RP-12b", "Ppoyaa/LuminRP-7B-128k-v0.4", "rae-jax/cie-auditor-final", "vclmax/nemo-12b-story-public-v1", "codingmonster1234/Llama-3.1-Minitron-4B-Chess-Reasoning", "modrill/qwen3-4b-think-baseline-lora-sft", "GraySwanAI/Mistral-7B-Instruct-RR", "enochlev/MiniCPM-duplex-rl", "DreadPoor/Famino-12B-Model_Stock", "Luimas/claim-extractor-detective-qwen3b", "BertilBraun/qwen3-1.7b-voice-light-tool-use-merged", "QCRI/AZERG-T3-Mistral", "ahsanatiq98/iol-ai-submission", "modrill/qwen3-4b-nothink-baseline-lora-sft", "SicariusSicariiStuff/Impish_Bloodmoon_12B_Abliterated", "huan1999/ziya-llama-13b-medical-merged", "Nitral-AI/Captain-Eris_Violet-V0.420-12B", "minhtt/vistral-7b-chat", "codellama/CodeLlama-34b-Python-hf", "modrill/qwen3-4b-think-baseline-full-sft", "kcherry497/dyno-blast-4b", "ld4ad/gemma-2-9b-dunhuang", "harindhar10/Olmo-7b_1M_Smiles_lora", "ishikauniphore/multilingual_reasoner_multilingual_cot", "DavidAU/granite-4.1-8b-Claude-Opus-4.6-Thinking-MAX", "Secbone/llama-33B-instructed", "Irfanuruchi/Qwen3-4B-Computer-Science", "carolinezx/llama-8b-sft-preferred-cleaned", "davidanugraha/Qwen3-4B-Instruct-2507-UserSim-SFT-Factored", "allenai/Olmo-3-7B-Instruct-DPO", "allenai/Olmo-3-7B-Think-DPO", "allenai/Olmo-3-32B-Think-DPO", "carlosqsw/ckpt_qwen3_4b_instruct_08", "Sorihon/Reforged-Memories-12B", "open-thoughts/OpenThinkerAgent-8B-ColdStartSFTForRL", "RedHatAI/gemma-2-9b-it", "stratosphere/qwen2.5-1.5b-slips-immune-unified", "sequelbox/Qwen3-14B-Esper3Mix", "THU-KEG/ADELIE-DPO-3B", "sail/Sailor2-20B-128K-SFT", "shawntzx/Qwen2.5-3B-GRPO-3_13_math", "hkust-nlp/drkernel-14b", "facebook/layerskip-llama3.2-1B", "Qwen/Qwen2.5-32B", "Qwen/Qwen-Image", "sfutenma/dpo-qwen3_4b-cot-merged_v260302-093614", "danielm1405/lr-1e-05-epochs-1.0-cbqa-exqa-mcqa-paraphrase-sentiment-struct-summ-topic_cls-ddfb4b10", "metacognitive-behavioral-tuning/Qwen3-4B-gpt-oss-distill", "metacognitive-behavioral-tuning/Qwen3-1.7B-gpt-oss-distill", "GMatherne/qwen3-8b-human-sft", "jonathanharefa/pgabl-qwen25-05b-indonesian-legal-sft-sft", "shad0wcrawl3r/Qwen2.5-1.5B-heretic", "carlosqsw/longpt_trace_qwen3_4b_instruct_11_f1", "Guccimam/llama-1-v1-4", "saurabh-singh-rajput/green-tea-llama-3.1-8b-energy-sft", "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think", "gguk2on/qwen2.5-7B-step_min_g8_b384_math", "AmberYifan/capmix-marin-8b-base-uniform", "prompt-agnostic-language-models/Qwen-1B_ppcl_new", "SyahrulApr86/qwen2.5-3b-legal-chatbot-id", "manucif/latamgpt-1b-sft", "Zynerji/Ektome-SmolLM2-1.7Bi-PristinelyUncensored", "Zynerji/Ektome-Qwen2-0.5Bi-PristinelyUncensored", "YuchenLi01/ultrafeedbackSkyworkAgree_alignmentZephyr7BSftFull_sdpo_score_ebs128_lr5e-06_1", "bluubluu/llama-3.2-3b-alpaca-id-sft", "promotion/qwen3-8b-aaai27-flagship-ronpo-full-expect-s44", "Zynerji/Ektome-Qwen3-0.6B-PristinelyUncensored", "DesiLadkaa/indian-finance-stage3-dpo-final", "Teleconnextions/llama-1b-fusion-v1", "TheDrummer/UnslopNemo-12B-v3", "ermiaazarkhalili/Qwen3-4B-SFT-Fable5", "xiaoqingsun004/Olmo-WildChat", "promotion/qwen3-8b-aaai27-flagship-dpo-s43", "OpenLLM-Ro/RoMistral-7b-Instruct", "longtermrisk/OLMo-3-7B-target-only-no-hallucination-sft", "ArliAI/Mistral-Nemo-12B-ArliAI-RPMax-v1.1", "longtermrisk/Qwen3-8B-old-bird-names-sft", "vimleshiit4463/wyzer-2.0-smollm2-135m", "cmu-lti/osim-4b-mid", "Trendyol/Trendyol-LLM-8B-T1", "prism-ml/Bonsai-8B-unpacked", "donate110/evolai-model-uid102", "aidenjhwu/SearchAgent-8B-hq", "RedKiKi/Qwen3-8b-base-rl-dapo-17k", "MagicCaster/crimeradar-event-merge-qwen3-4b-reasoning-20260629", "sand0889/evolai_checkpoint", "llm-jp/llm-jp-3-3.7b-instruct2", "Siddh07ETH/Pluto-Genesis-0.6B", "prism-ml/Ternary-Bonsai-1.7B-unpacked", "ellamind/propella-1-0.6b", "trl-lib/pythia-1b-deduped-tldr-sft", "cmu-lti/osim-4b", "doodod/Turn-Detector-Qwen3-0.6B", "AliesTaha/fable-traces", "ACE-Step/acestep-5Hz-lm-0.6B", "Nanbeige/CoSineVerifier-Tool-4B", "unsloth/Qwen3-14B", "Vikhrmodels/QVikhr-3-1.7B-Instruction-noreasoning", "unsloth/Qwen3-0.6B", "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT", "SWE-Lego/SWE-Lego-Qwen3-8B", "Gueule-d-ange/aup-fullft-kto_mmd-mmdrho5.19e-3_kr0.1-seed4", "Gueule-d-ange/aup-fullft-kto_kl-klam0.0333_beta0.1-seed4", "Gueule-d-ange/aup-fullft-kto_w1_mmd-w1lam8.4e-4_mmdrho8.4e-4_kr0.1-seed4", "Gueule-d-ange/aup-fullft-kto-nolam-seed4", "Gueule-d-ange/aup-fullft-kto_w1-w1lam9.68e-4-seed4", "TDC2023/trojan-base-pythia-1.4b-dev-phase", "Gueule-d-ange/aup-fullft-kto_w1-w1lam9.68e-4-seed1337", "Gueule-d-ange/aup-fullft-kto_w1_mmd-w1lam8.4e-4_mmdrho8.4e-4_kr0.1-seed1337", "Gueule-d-ange/aup-fullft-kto_mmd-mmdrho5.19e-3_kr0.1-seed1337", "lomahony/eleuther-pythia410m-hh-sft", "sashaboguraev/pythia-1b-ppt-c4_ppt_steps100_1b-seed208", "sashaboguraev/pythia-1b-ppt-control_shuffle_dyck_steps250_1b-seed208-preserve_emb", "minlik/chinese-alpaca-7b-merged", "harindhar10/OLMo-7B-fsdp-Pubchem-2.5M-1epochs-eos", ] KUNLUNXIN_MODELS = [ "Adithyaaaa/chemistry-mistral-7b-v0.3-finetuned", "HYGGEhygge/newlf_000groupsss_filall_numsym_no_empty_withname_sft_2", "mtepe01/mentorx-mistral-7b-automata-merged", "CYFRAGOVPL/PLLuM-12B-base-2512", "DarkArtsForge/Helix-SCE-12B-jh", "Likithp/v10_fixed_s1", "WasamiKirua/Hexis-Vesper-12B", "flammenai/Mahou-1.5-mistral-nemo-12B", "Likithp/v10_rand_s1", "ibm-granite/granite-3.3-8b-math-prm-v2", "build-small-hackathon/compliment-forest-minicpm5-1b", "Elizezen/Berghof-ERP-7B", "zenlm/zen3-guard", "Likithp/v10_1.5B_fixed_s42", "ermiaazarkhalili/Granite-4.1-8B-SFT-Fable5", "Mohamed475/qwen3-1.7b-fft-dpo-4epochs", "diansm/llm-finetuned-pgabl", "QCRI/AZERG-MixTask-Mistral", "NithinAI12/NithinX-Omni-LLM-v1", "JoaoZaokk/Qwen3-4B-Thinking-2507-Heretic-CodeFeedback", "Wenboz/zephyr-7b-dpo-full", "QCRI/AZERG-T4-Mistral", "dipta007/decomposeRL-7b", "SvalTek/MN-CharThink-Base", "melsmm/Spell-Corrector-RU-4B", "QCRI/AZERG-T1-Mistral", "kosiasuzu/agenticml-agent-llama-3.1-8b-init", "vclmax/nemo-12b-expansion-v1", "Vortex5/Silver-Siren-12B", "ArliAI/Mistral-Nemo-12B-ArliAI-RPMax-v1.2", "kosiasuzu/chatml-agent-llama-3.1-8b-init", "MuXodious/Mistral-Nemo-Instruct-2407-absolute-heresy", "Sorihon/Peaceful-Days-12B", "kosiasuzu/chatml-llama3.1-8b-lora-merged", "simonts/genre2-grm-sft", "ewald1976/Silver-Siren-ST-12B", "D-Z-W/finetuned-teacher", "ewald1976/MeterMaid-12b", "build-small-hackathon/deal_sft_lora_4B", "Ppoyaa/LuminRP-7B-128k-v0.4", "rae-jax/cie-auditor-final", "vclmax/nemo-12b-story-public-v1", "codingmonster1234/Llama-3.1-Minitron-4B-Chess-Reasoning", "modrill/qwen3-4b-think-baseline-lora-sft", "DreadPoor/Famino-12B-Model_Stock", "Luimas/claim-extractor-detective-qwen3b", "QCRI/AZERG-T3-Mistral", "YuchenLi01/ultrafeedbackSkyworkAgree_alignmentZephyr7BSftFull_sdpo_score_ebs64_lr1e-07_2", "royallab/MN-LooseCannon-12B-v2", "modrill/qwen3-4b-nothink-baseline-lora-sft", "AnkitBirGurung/Helpful_NEMO_12B_SFT_Further", "SicariusSicariiStuff/Impish_Bloodmoon_12B_Abliterated", "edusc182/Zen-AI-3B-Full", "Nitral-AI/Captain-Eris_Violet-V0.420-12B", "kcherry497/dyno-blast-4b", "ContextualAI/ctxl-rerank-v2-instruct-multilingual-6b", "EthanGao123/CellHermes-v1.0", "RecursiveMAS/Mixture-Science-BioMistral-7B", "chenyitian-shanshu/SIRL-Gurobi", "RedHatAI/gemma-2-9b-it", "gaunernst/gemma-3-27b-it-qat-autoawq", "promotion/qwen3-8b-simpo-avg-b2p5-g1p0-s42", "allenai/OLMoE-1B-7B-0924-SFT", "llamaindex/vdr-2b-multi-v1", "KordAI/Typhoon-Gemma3-KordTranslate-EN-TH-4B", "TheDrummer/UnslopNemo-12B-v3", "gradients-io-tournaments/tournament-tourn_c5d86c82ce819a79_20260706-b78a01d4-0a6a-49e1-9190-5e88ae329937-5DS6XMVr", "OpenLLM-Ro/RoMistral-7b-Instruct", "ArliAI/Mistral-Nemo-12B-ArliAI-RPMax-v1.1", ] BIREN_MODELS = [ "EphemeralYou/Prompt-Refine-MiniCPM5-1B", "mtepe01/mentorx-mistral-7b-automata-merged", "DarkArtsForge/Helix-SCE-12B-jh", "Likithp/v10_fixed_s1", "Likithp/v10_rand_s1", "ibm-granite/granite-3.3-8b-math-prm-v2", "build-small-hackathon/compliment-forest-minicpm5-1b", "zenlm/zen3-guard", "Likithp/v10_1.5B_fixed_s42", "ermiaazarkhalili/Granite-4.1-8B-SFT-Fable5", "Mohamed475/qwen3-1.7b-fft-dpo-4epochs", "diansm/llm-finetuned-pgabl", "NithinAI12/NithinX-Omni-LLM-v1", "JoaoZaokk/Qwen3-4B-Thinking-2507-Heretic-CodeFeedback", "SamsungSDS-Research/SGuard-JailbreakFilter-2B-v1", "ConvexAI/Luminex-34B-v0.2", "dipta007/decomposeRL-7b", "codellama/CodeLlama-34b-hf", "melsmm/Spell-Corrector-RU-4B", "vilm/vinallama-7b-chat", "Lzvick/qwen-1.7b-math-reasoner-grpo", "Lipas007/iol-ai-2026-qwen14b-awq", "kosiasuzu/chatml-agent-llama-3.1-8b-init", "kosiasuzu/chatml-llama3.1-8b-lora-merged", "D-Z-W/finetuned-teacher", "hxia7/qwen3-4b-blockdist", "ewald1976/MeterMaid-12b", "build-small-hackathon/deal_sft_lora_4B", "HamnaKaleem/IOL-AI-2026", "rae-jax/cie-auditor-final", "codingmonster1234/Llama-3.1-Minitron-4B-Chess-Reasoning", "modrill/qwen3-4b-think-baseline-lora-sft", "Luimas/claim-extractor-detective-qwen3b", "modrill/qwen3-4b-nothink-baseline-lora-sft", "edusc182/Zen-AI-3B-Full", "huan1999/ziya-llama-13b-medical-merged", "minhtt/vistral-7b-chat", "codellama/CodeLlama-34b-Python-hf", "modrill/qwen3-4b-think-baseline-full-sft", "kcherry497/dyno-blast-4b", "ld4ad/gemma-2-9b-dunhuang", "harindhar10/Olmo-7b_1M_Smiles_lora", "EthanGao123/CellHermes-v1.0", "4dil/coding-architecture-advisor-merged", "DavidAU/granite-4.1-8b-Claude-Opus-4.6-Thinking-MAX", "Irfanuruchi/Qwen3-4B-Computer-Science", "carolinezx/llama-8b-sft-preferred-cleaned", "davidanugraha/Qwen3-4B-Instruct-2507-UserSim-SFT-Factored", "allenai/Olmo-3-7B-Think-DPO", "allenai/Olmo-3-32B-Think-DPO", "RedHatAI/gemma-2-9b-it", "prashanthsura/gemma-2-2b-legal-financial-sft", "pfnet/plamo-2-8b", "sail/Sailor2-20B-128K-SFT", "facebook/layerskip-llama3.2-1B", "Qwen/Qwen2.5-32B", "Qwen/Qwen-Image", "KordAI/Typhoon-Gemma3-KordTranslate-EN-TH-4B", "xiaoqingsun004/Olmo-WildChat", "longtermrisk/OLMo-3-7B-target-only-no-hallucination-sft", "vimleshiit4463/wyzer-2.0-smollm2-135m", "trl-lib/pythia-1b-deduped-tldr-sft", ] CAMBRICON_MODELS = [ "EphemeralYou/Prompt-Refine-MiniCPM5-1B", "ToxicityPrompts/PolyGuard-Ministral", "Adithyaaaa/chemistry-mistral-7b-v0.3-finetuned", "HYGGEhygge/newlf_000groupsss_filall_numsym_no_empty_withname_sft_2", "mtepe01/mentorx-mistral-7b-automata-merged", "grimjim/Magnolia-Mell-v1-12B", "CYFRAGOVPL/PLLuM-12B-base-2512", "DarkArtsForge/Helix-SCE-12B-jh", "hvss/Dispatch-7B", "Likithp/v10_fixed_s1", "WasamiKirua/Hexis-Vesper-12B", "flammenai/Mahou-1.5-mistral-nemo-12B", "Likithp/v10_rand_s1", "ibm-granite/granite-3.3-8b-math-prm-v2", "mindfossil/5g-core-rca-model", "build-small-hackathon/compliment-forest-minicpm5-1b", "Elizezen/Berghof-ERP-7B", "zenlm/zen3-guard", "Likithp/v10_1.5B_fixed_s42", "ermiaazarkhalili/Granite-4.1-8B-SFT-Fable5", "Mohamed475/qwen3-1.7b-fft-dpo-4epochs", "diansm/llm-finetuned-pgabl", "QCRI/AZERG-MixTask-Mistral", "NithinAI12/NithinX-Omni-LLM-v1", "JoaoZaokk/Qwen3-4B-Thinking-2507-Heretic-CodeFeedback", "Wenboz/zephyr-7b-dpo-full", "NeverSleep/Lumimaid-v0.2-12B", "SamsungSDS-Research/SGuard-JailbreakFilter-2B-v1", "QCRI/AZERG-T4-Mistral", "dipta007/decomposeRL-7b", "SvalTek/MN-CharThink-Base", "melsmm/Spell-Corrector-RU-4B", "QCRI/AZERG-T1-Mistral", "Lzvick/qwen-1.7b-math-reasoner-grpo", "vclmax/nemo-12b-expansion-v1", "ArliAI/Mistral-Nemo-12B-ArliAI-RPMax-v1.2", "kosiasuzu/chatml-agent-llama-3.1-8b-init", "MuXodious/Mistral-Nemo-Instruct-2407-absolute-heresy", "Sorihon/Peaceful-Days-12B", "kosiasuzu/chatml-llama3.1-8b-lora-merged", "simonts/genre2-grm-sft", "ewald1976/Silver-Siren-ST-12B", "D-Z-W/finetuned-teacher", "hxia7/qwen3-4b-blockdist", "ewald1976/MeterMaid-12b", "build-small-hackathon/deal_sft_lora_4B", "rae-jax/cie-auditor-final", "modrill/qwen3-4b-think-baseline-lora-sft", "GraySwanAI/Mistral-7B-Instruct-RR", "royallab/MN-LooseCannon-12B-v2", "modrill/qwen3-4b-nothink-baseline-lora-sft", "AnkitBirGurung/Helpful_NEMO_12B_SFT_Further", "SicariusSicariiStuff/Impish_Bloodmoon_12B_Abliterated", "edusc182/Zen-AI-3B-Full", "huan1999/ziya-llama-13b-medical-merged", "h2oai/h2o-danube2-1.8b-base", "Nitral-AI/Captain-Eris_Violet-V0.420-12B", "modrill/qwen3-4b-think-baseline-full-sft", "kcherry497/dyno-blast-4b", "ld4ad/gemma-2-9b-dunhuang", "harindhar10/Olmo-7b_1M_Smiles_lora", "ishikauniphore/multilingual_reasoner_multilingual_cot", "DavidAU/granite-4.1-8b-Claude-Opus-4.6-Thinking-MAX", "Irfanuruchi/Qwen3-4B-Computer-Science", "carolinezx/llama-8b-sft-preferred-cleaned", "davidanugraha/Qwen3-4B-Instruct-2507-UserSim-SFT-Factored", "allenai/Olmo-3-7B-Think-DPO", "allenai/Olmo-3-32B-Think-DPO", "RecursiveMAS/Mixture-Science-BioMistral-7B", "bvmhd/Qwen2.5-1.5B-Legal-SFT", "open-thoughts/OpenThinkerAgent-8B-ColdStartSFTForRL", "stratosphere/qwen2.5-1.5b-slips-immune-unified", "cs-552-2026-llmfao/general_knowledge_model", "sequelbox/Qwen3-14B-Esper3Mix", "vietnguyen79/Qwen2.5-0.2B", "0xgr3y/Qwen3-0.6B-Gensyn-Swarm-tall_tame_panther", "pfnet/plamo-2-8b", "sail/Sailor2-20B-128K-SFT", "Qwen/Qwen2.5-32B", "Qwen/Qwen-Image", "ibm-granite/granite-4.1-8b-base", "danielm1405/lr-1e-05-epochs-1.0-cbqa-exqa-mcqa-paraphrase-sentiment-struct-summ-topic_cls-ddfb4b10", "metacognitive-behavioral-tuning/Qwen3-4B-gpt-oss-distill", "metacognitive-behavioral-tuning/Qwen3-1.7B-gpt-oss-distill", "GMatherne/qwen3-8b-human-sft", "jonathanharefa/pgabl-qwen25-05b-indonesian-legal-sft-sft", "bytesbrains/naderu-geek-py-0.5b", "shad0wcrawl3r/Qwen2.5-1.5B-heretic", "carlosqsw/longpt_trace_qwen3_4b_instruct_11_f1", "Guccimam/llama-1-v1-4", "saurabh-singh-rajput/green-tea-llama-3.1-8b-energy-sft", "PursuitOfDataScience/Argonne-Qwen1.5-0.5B-think", "gguk2on/qwen2.5-7B-step_min_g8_b384_math", "ismailelsayedeltanja/Qwen2.5-1.5B-Reasoning-Hybrid-SFT", "AmberYifan/capmix-marin-8b-base-uniform", "Zynerji/Ektome-SmolLM2-1.7Bi-PristinelyUncensored", "Zynerji/Ektome-Qwen2-0.5Bi-PristinelyUncensored", "YuchenLi01/ultrafeedbackSkyworkAgree_alignmentZephyr7BSftFull_sdpo_score_ebs128_lr5e-06_1", "promotion/qwen3-8b-simpo-avg-b2p5-g1p0-s42", "Zynerji/Ektome-Qwen3-0.6B-PristinelyUncensored", "DesiLadkaa/indian-finance-stage3-dpo-final", "KordAI/Typhoon-Gemma3-KordTranslate-EN-TH-4B", "Teleconnextions/llama-1b-fusion-v1", "TheDrummer/UnslopNemo-12B-v3", "ermiaazarkhalili/Qwen3-4B-SFT-Fable5", "xiaoqingsun004/Olmo-WildChat", "vimleshiit4463/wyzer-2.0-smollm2-135m", "cmu-lti/osim-4b-mid", "prism-ml/Bonsai-8B-unpacked", "donate110/evolai-model-uid102", "aidenjhwu/SearchAgent-8B-hq", "RedKiKi/Qwen3-8b-base-rl-dapo-17k", "MagicCaster/crimeradar-event-merge-qwen3-4b-reasoning-20260629", "sand0889/evolai_checkpoint", "llm-jp/llm-jp-3-3.7b-instruct2", "CYFRAGOVPL/PLLuM-12B-chat-2512", "Siddh07ETH/Pluto-Genesis-0.6B", "prism-ml/Ternary-Bonsai-1.7B-unpacked", "ellamind/propella-1-0.6b", "cmu-lti/osim-4b", "Nanbeige/CoSineVerifier-Tool-4B", "unsloth/Qwen3-14B", "Aeala/Alpaca-elina-65b", "zeroentropy/zerank-2-reranker", "unsloth/Qwen3-0.6B", "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT", "jondurbin/airoboros-7b-gpt4", "SWE-Lego/SWE-Lego-Qwen3-8B", "Gueule-d-ange/aup-fullft-kto_mmd-mmdrho5.19e-3_kr0.1-seed4", "Gueule-d-ange/aup-fullft-kto_kl-klam0.0333_beta0.1-seed4", "Gueule-d-ange/aup-fullft-kto_w1_mmd-w1lam8.4e-4_mmdrho8.4e-4_kr0.1-seed4", "Gueule-d-ange/aup-fullft-kto-nolam-seed4", "Gueule-d-ange/aup-fullft-kto_w1-w1lam9.68e-4-seed4", "gulsmyigit/base_PLABA-slerp_merged_ministral8b", ] # 按顺序处理:MetaX → Kunlunxin → Biren → Cambricon GPU_JOBS: List[Tuple[str, List[str]]] = [ ("MetaX_c-500", METAX_MODELS), ("Kunlunxin_p-800", KUNLUNXIN_MODELS), ("Biren_166m", BIREN_MODELS), ("Cambricon_mlu-370-x8", CAMBRICON_MODELS), ] TOTAL_MODELS = sum(len(models) for _, models in GPU_JOBS) # ══════════════════════════════════════════════════════════ # 全局状态(供 /status 展示) # ══════════════════════════════════════════════════════════ _state = { "strategy_id": STRATEGY_ID, "phase": "starting", # starting | submitting | done | error "total": TOTAL_MODELS, "submitted": 0, "failed": 0, "per_account": {label: 0 for label, _, _ in ACCOUNTS}, "current_account": ACCOUNTS[0][0], "started_at": None, "finished_at": None, } _shutdown = threading.Event() # ══════════════════════════════════════════════════════════ # HTTP 服务 # ══════════════════════════════════════════════════════════ class Handler(BaseHTTPRequestHandler): def do_GET(self): if self.path == "/health": self._json({"status": "ok"}) elif self.path == "/status": self._json(_state) else: self._json({"error": "not found"}, 404) def _json(self, body: dict, code: int = 200): payload = json.dumps(body, default=str).encode() self.send_response(code) self.send_header("Content-Type", "application/json") self.send_header("Content-Length", str(len(payload))) self.end_headers() self.wfile.write(payload) def log_message(self, fmt, *args): print(f"[http] {self.address_string()} {fmt % args}", flush=True) def _run_http(): server = ThreadingHTTPServer((HTTP_HOST, HTTP_PORT), Handler) server.timeout = 1 print(f"[http] 监听 {HTTP_HOST}:{HTTP_PORT}", flush=True) while not _shutdown.is_set(): server.handle_request() server.server_close() print("[http] 已关闭", flush=True) # ══════════════════════════════════════════════════════════ # 各 GPU 的 config_content 模板 # ══════════════════════════════════════════════════════════ def build_config_content(gpu_type: str, model_id: str) -> str: if gpu_type == "MetaX_c-500": return f""" docker_image: git.modelhub.org.cn:9443/enginex-metax/vllm:0.9.1 nv_docker_image: harbor.4pd.io/dooke/vllm/vllm/vllm-openai:v0.11.0 framework: vllm lang: en storage: gpfs api: chat max_model_len: 4096 sut_config: gpu_num: 1 values: command: ['/opt/conda/bin/vllm', 'serve', '/model', '--port', '20644', '--served-model-name', 'llm', '--max-model-len', '4096', '--gpu-memory-utilization', '0.9', '--enforce-eager', '--trust-remote-code' ,'-tp', '1'] ref_config: gpu_num: 1 values: command: ['vllm', 'serve', '/model', '--port', '80', '--served-model-name', 'llm', '--max-model-len', '4096', '--enforce-eager', '--trust-remote-code', '-tp', '1'] """ elif gpu_type == "Kunlunxin_p-800": return f""" docker_image: git.modelhub.org.cn:9443/enginex/xc-llm-kunlun nv_docker_image: harbor.4pd.io/dooke/vllm/vllm/vllm-openai:v0.11.0 framework: vllm lang: en storage: gpfs api: chat temperature: 0.4 repetition_penalty: 1.1 top_p: 0.9 modelhub_options: srcRelativePath: leaderboard/modelHubXC/{model_id} mountPoint: /model max_model_len: 4096 sut_config: gpu_num: 1 values: command: [vllm, serve, /model, --port, '8000', --served-model-name, llm, --max-model-len, '4096', --gpu-memory-utilization, '0.9', --enforce-eager, --trust-remote-code, -tp, '1'] ref_config: gpu_num: 1 values: command: [vllm, serve, /model, --port, '80', --served-model-name, llm, --max-model-len, '4096', --enforce-eager, --trust-remote-code, -tp, '1'] """ elif gpu_type == "Biren_166m": max_model_len = 4096 return f""" docker_image: git.modelhub.org.cn:9443/enginex/xc-llm-biren166m:26.01 nv_docker_image: harbor.4pd.io/dooke/vllm/vllm/vllm-openai:v0.11.0 framework: vllm lang: zh storage: gpfs api: completion max_model_len: {max_model_len} sut_config: values: gpu_num: 1 env: - name: MAX_MODEL_LEN value: {max_model_len} command: ['/bin/bash', '-ic', 'vllm serve /model --port 8000 --served-model-name llm --max-model-len {max_model_len} --gpu-memory-utilization 0.9 --enforce-eager --trust-remote-code -tp 1 --host 0.0.0.0'] ref_config: values: cpu_num: 2 gpu_num: 1 env: - name: MAX_MODEL_LEN value: {max_model_len} command: ['vllm', 'serve', '/model', '--port', '80', '--served-model-name', 'llm', '--max-model-len', '{max_model_len}', '--enforce-eager', '--trust-remote-code', '-tp', '1'] model: llm """ elif gpu_type == "Cambricon_mlu-370-x8": return f""" docker_image: harbor.4pd.io/hardcore-tech/cambricon-mlu370-pytorch:v25.01-torch2.5.0-torchmlu1.24.1-ubuntu22.04-py310 nv_docker_image: harbor.4pd.io/dooke/vllm/vllm/vllm-openai:v0.11.0 framework: vllm storage: gpfs sut_config: values: gpu_num: 1 env: - name: MAX_MODEL_LEN value: 8192 command: ["vllm", "serve", "/model", "--port", "8000", "--served-model-name", "llm", "--max-model-len", "8192", "--trust-remote-code", "--dtype", "float16"] ref_config: values: cpu_num: 2 gpu_num: 1 env: - name: MAX_MODEL_LEN value: 8192 command: ["vllm", "serve", "/model", "--port", "80", "--served-model-name", "llm", "--max-model-len", "8192", "--trust-remote-code", "--dtype", "float16"] """ else: raise ValueError(f"未知的 GPU_TYPE: {gpu_type}") # ══════════════════════════════════════════════════════════ # 业务逻辑 # ══════════════════════════════════════════════════════════ def submit_task(gpu_type: str, xc_token: str, model_id: str): """返回 (code, message);code == 0 表示提交成功。""" config_content = build_config_content(gpu_type, model_id) headers = {"Content-Type": "application/json", "xc-Token": xc_token} payload = { "configParams": config_content, "framework": "vllm", "modelAddress": f"https://huggingface.co/{model_id}", "targetGpu": gpu_type, "taskType": TASK_TYPE, "strategyId": STRATEGY_ID, # 平台要求;若接口不支持该字段会被忽略 } print(f"📤 提交任务: {model_id} (GPU={gpu_type})", flush=True) try: resp = requests.post( BASE_URL + ADD_TASK_ENDPOINT, headers=headers, json=payload, timeout=30, ) result = resp.json() print(f"status={resp.status_code} result={result}", flush=True) return result.get("code"), result.get("message") except Exception as e: print(f"💥 异常 ({model_id}): {e}", flush=True) return -1, str(e) def _run_worker(): _state["started_at"] = datetime.utcnow().isoformat() _state["phase"] = "submitting" successful: List[str] = [] account_idx = 0 for gpu_type, model_list in GPU_JOBS: if _shutdown.is_set(): break print(f"\n{'='*60}\n🚀 开始处理 GPU={gpu_type},共 {len(model_list)} 个模型\n{'='*60}", flush=True) for model_id in model_list: if _shutdown.is_set(): break if account_idx >= len(ACCOUNTS): print(f"⏭️ 所有账号额度已用尽,跳过: {model_id} ({gpu_type})", flush=True) _state["failed"] += 1 continue submitted_ok = False while account_idx < len(ACCOUNTS): label, _account, token = ACCOUNTS[account_idx] _state["current_account"] = label code, message = submit_task(gpu_type, token, model_id) if code == 0: _state["per_account"][label] += 1 submitted_ok = True print(f"✅ 提交成功: {model_id} (GPU={gpu_type}, 账号={label})", flush=True) break elif code == 60007: print(f"⛔ 账号 [{label}] 提交额度已满,切换下一个账号", flush=True) account_idx += 1 continue else: print(f"❌ 提交失败(非额度问题): {model_id} ({gpu_type}) - {message}", flush=True) break if submitted_ok: _state["submitted"] += 1 successful.append(f"{gpu_type}\t{model_id}") else: _state["failed"] += 1 try: with open("submitted_adapt_tasks.txt", "w", encoding="utf-8") as f: for line in successful: f.write(line + "\n") except Exception: pass _state["finished_at"] = datetime.utcnow().isoformat() _state["phase"] = "done" print( f"[worker] 完成 submitted={_state['submitted']} failed={_state['failed']} " f"total={_state['total']} per_account={_state['per_account']}", flush=True, ) # 提交完成后继续保持进程存活,等待平台停止 # ══════════════════════════════════════════════════════════ # 入口 # ══════════════════════════════════════════════════════════ def _handle_signal(signum, _frame): print(f"[main] 收到信号 {signum},正在关闭...", flush=True) _shutdown.set() def main(): signal.signal(signal.SIGTERM, _handle_signal) signal.signal(signal.SIGINT, _handle_signal) http_thread = threading.Thread(target=_run_http, daemon=False) http_thread.start() worker_thread = threading.Thread(target=_run_worker, daemon=True) worker_thread.start() _shutdown.wait() print("[main] 等待 HTTP 服务关闭...", flush=True) http_thread.join(timeout=5) print("[main] 退出", flush=True) if __name__ == "__main__": main()