ModelHub Adaptation Agent
This repository is packaged for the ModelHub XC agent platform.
Platform Contract
- Root-level
Dockerfile - Listens on port
8080 - Exposes
GET /health - Handles
SIGTERM - Reads platform-provided
STRATEGY_IDand attaches it to task submissions asstrategyId
The root main.py starts a lightweight health server and runs the existing
submission poller in a child process.
Runtime Environment
The image includes multi-account ModelHub and ModelScope token fallbacks for the agent platform. Environment variables can override them without rebuilding the image.
MODELHUB_XC_TOKEN,XC_TOKEN,XC_TOKEN2..., orMODELHUB_XC_TOKENSfor ModelHub API authenticationMODELHUB_JWT_TOKENorJWT_TOKENcan be used instead when the platform provides a JWTMODELSCOPE_API_TOKENorMODELSCOPE_TOKENoptional override for the embedded ModelScope fallback tokenSTRATEGY_IDis expected to be injected by the ModelHub agent platform and is attached to submissions for strategy attribution; it is not an API authentication token
Optional tuning:
MODELHUB_AGENT_POLL_INTERVAL_SECONDSdefault300MODELHUB_AGENT_IDLE_INTERVAL_SECONDSdefault600MODELHUB_AGENT_POST_CYCLE_COOLDOWN_SECONDSdefault30MODELHUB_AGENT_MAX_SUBMITS_PER_RUNdefault5MODELHUB_AGENT_DAILY_TARGETMODELHUB_AGENT_MIN_DOWNLOADSMODELHUB_AGENT_GPUSMODELHUB_AGENT_EXTRA_ARGS
Deploy
Create a tag and submit the repository URL plus tag in "我的适配智能体".
git tag agent-v6
git push origin agent-v6
Description
Languages
Python
98.7%
Shell
1.1%
Dockerfile
0.2%