CoolFace
Apppublic

rockyaaos/qm9-mist-live-demo

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
App README

QM9 MIST live comparison — private-serving Docker Space

This Docker Space serves one SMILES at a time through four fixed QM9 property predictors:

  • —ECFP4 + Ridge
  • —ECFP4 + 12 XGBoost regressors
  • —ECFP4 + 12-output MLP
  • —the released fine-tuned MIST-28M QM9 checkpoint

It returns the 12 QM9 properties, including HOMO, LUMO, and gap. Predictions are QM9 computational-property estimates; they are not experimental values or a new benchmark score.

What this repository does not contain

No model weights, data rows, prediction rows, tokens, or local machine paths are committed here. At runtime the app obtains:

  1. 1.MIST from its original public repository at the fixed revision mist-models/mist-26.9M-kkgx0omx-qm9@65ceeed479609e9dcaef04e687556e2b39e25f23.
  2. 2.Ridge/XGBoost/MLP serving artifacts from the private Hugging Face dataset repository named by LIVE_DEMO_BUNDLE_REPO, using the HF_TOKEN secret.

The private dataset must contain the files produced by the bundle builder at its repository root: bundle_manifest.json, ridge.npz, twelve xgboost_<target>.json files, mlp.safetensors, mlp_architecture.json, and mlp_scaler.npz. The startup loader verifies the manifest hashes before it loads an artifact.

The Docker image deliberately installs the CPU-only PyTorch wheel. A GPU Space can use the same application code, but this scaffold does not require or claim GPU availability.

Required Space secrets and variables

Set these in the Space Settings page; never put them in this repository.

NameTypeMeaning
HF_TOKENSecretRead token with access to the private dataset bundle
LIVE_DEMO_BUNDLE_REPOVariablePrivate dataset repo ID, e.g. owner/qm9-live-demo-bundle
LIVE_DEMO_ALLOWED_ORIGINVariable, optionalOne additional exact HTTPS browser origin
LIVE_DEMO_RATE_LIMIT_PER_MINUTEVariable, optionalPer-client in-memory request limit; default 30

Browser CORS is limited to https://sciencesloop.com, https://www.sciencesloop.com, and the optional exact extra origin. Wildcards and non-HTTPS extra origins are rejected during startup.

Endpoints

  • —GET /healthz
  • —GET /v1/model-card
  • —POST /v1/predict

Example:

bash
curl -X POST "$SPACE_URL/v1/predict" \
  -H 'content-type: application/json' \
  --data '{"smiles":"CCO"}'

Only a smiles field is accepted. It has a 512-character limit and is checked with RDKit. Clients cannot choose a model, checkpoint, path, device, or URL.

Local container run

bash
export HF_TOKEN='…'
export LIVE_DEMO_BUNDLE_REPO='owner/qm9-live-demo-bundle'
docker build -t qm9-live-space .
docker run --rm -p 7860:7860 \
  -e HF_TOKEN -e LIVE_DEMO_BUNDLE_REPO qm9-live-space

The service binds to port 7860 and uses no access logging. See DEPLOYMENT.md for the exact private-bundle upload and Space creation steps.