Skip to content

DarkStarStrix/SciMLHub

Repository files navigation

SciML Hub

Python 3.9+ API Status Documentation

SciML Hub is a unified platform for scientific machine learning, providing state-of-the-art Nexa models for predictions in biology (protein structure), astrophysics (stellar properties), and materials science (material properties). Access these models via a simple REST API, with results returned in JSON format including predictions and confidence scores (0-100%).

Quick Start

Prerequisites

  • Python 3.9+
  • An API key (sign up at scimlhub.com to get yours)
  • requests library (pip install requests)

Example: Protein Structure Prediction

Predict the secondary structure of a protein sequence:

import requests

response = requests.post(
    "https://api.scimlhub.com/v1/bio/predict",
    headers={"X-API-Key": "your_api_key"},
    json={"sequence": "MAKQVKL"}
)

result = response.json()
print(result)
# Output: {"prediction": "H", "confidence": 80.56}

Example: Stellar Property Prediction

Estimate a star's mass:

response = requests.post(
    "https://api.scimlhub.com/v1/astro/predict",
    headers={"X-API-Key": "your_api_key"},
    json={
        "temp": 5778,  # Kelvin
        "luminosity": 1.0,  # Solar luminosity
        "metallicity": 0.0  # [Fe/H]
    }
)

result = response.json()
print(f"Stellar Mass: {result['prediction']} Solar masses")
print(f"Confidence: {result['confidence']}%")
# Output: {"prediction": 1.0, "confidence": 97.49}

Example: Material Property Prediction

Predict a material's band gap:

response = requests.post(
    "https://api.scimlhub.com/v1/materials/predict",
    headers={"X-API-Key": "your_api_key"},
    json={"structure": "POSCAR data string"}
)

result = response.json()
print(f"Band Gap: {result['prediction']} eV")
print(f"Confidence: {result['confidence']}%")
# Output: {"prediction": 2.5, "confidence": 98.5}

Core Models

Biology: HelixSynth-Pro (Protein Structure Prediction)

  • Model: Variational Autoencoder (VAE) with diffusion
  • Purpose: Predicts protein secondary structures (H: Helix, E: Sheet, C: Coil)
  • Accuracy: 70.82% overall (Q3 score)
  • Latency: ~78ms
  • Details: See helixsynth-pro.ipynb and Technical_Whitepaper/analysis_results_20250219_202508.txt

Astrophysics: Stellar Classification

  • Model: Ensemble (Random Forest, CatBoost, Neural Network)
  • Purpose: Predicts stellar properties (mass, class: QSO, GALAXY, STAR)
  • Accuracy: 97.49% on validation set
  • Latency: ~45ms
  • Details: See Technical_Whitepaper/Astrophysics results.txt

Materials Science: Materials GNN

  • Model: Graph Neural Network (GNN)
  • Purpose: Predicts material properties (band gap, formation energy)
  • Accuracy: 98.5% on crystal structures
  • Latency: ~62ms
  • Details: See Material Science/generated_structures.csv

API Usage

The API endpoints return predictions and confidence scores in JSON format: {"prediction": value, "confidence": percentage}.

Endpoints

1. /v1/bio/predict - Protein Structure Prediction

  • Method: POST
  • Input:
    {
      "sequence": "MAKQVKL"  // Amino acid sequence (up to 1000 residues)
    }
  • Output:
    {
      "prediction": "H",  // H (Helix), E (Sheet), C (Coil)
      "confidence": 80.56  // Confidence in percentage (0-100)
    }

2. /v1/astro/predict - Stellar Property Prediction

  • Method: POST
  • Input:
    {
      "temp": 5778,        // Temperature in Kelvin
      "luminosity": 1.0,   // Luminosity in solar units
      "metallicity": 0.0   // Metallicity [Fe/H]
    }
  • Output:
    {
      "prediction": 1.0,   // Mass in solar masses
      "confidence": 97.49  // Confidence in percentage (0-100)
    }

3. /v1/materials/predict - Material Property Prediction

  • Method: POST
  • Input:
    {
      "structure": "POSCAR data string"  // Crystal structure in POSCAR format
    }
  • Output:
    {
      "prediction": 2.5,   // Band gap in eV
      "confidence": 98.5   // Confidence in percentage (0-100)
    }

Authentication

Include your API key in the request header:

X-API-Key: your_api_key

Error Responses

  • 400 Bad Request: Invalid input format
  • 401 Unauthorized: Missing or invalid API key
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Server Error: Internal issue (contact support)

Installation (Local Development)

  1. Clone the Repository:

    git clone https://github.com/DarkStarStrix/scimlhub.git
    cd scimlhub
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Run the API Locally:

    python app/main.py

    The API will be available at http://localhost:8000.

  4. Docker Deployment (Optional):

    docker-compose -f docker/docker-compose.yml up --build

Key Features

  • Fast: Average response time ~50ms
  • Accurate: >95% accuracy across domains
  • Reliable: Confidence scores with every prediction
  • Scalable: Supports millions of requests daily
  • Secure: SOC2 Type II compliant

Example Outputs

Protein Structure

{
  "prediction": "H",
  "confidence": 80.56
}

Astrophysics

{
  "prediction": "GALAXY",
  "confidence": 97.29
}

Materials Science

{
  "prediction": 2.5,
  "confidence": 98.5
}

Use Cases

  • Biology: Protein design, drug discovery
  • Astrophysics: Stellar classification, exoplanet research
  • Materials Science: Material discovery, energy applications

Pricing

Plan Requests/Month Price
Free 300 $0
Premium-1K 1,000 $50/month
Premium-5K 5,000 $35/month
Premium-10K 10,000 $25/month
Enterprise Unlimited Custom

Resources

Enterprise Support

For custom models, on-premise deployment, or integration help, email: [email protected].

Support

License

Commercial license - see LICENSE