Skip to main content

SCARCITY core simulation, federation, and governance library.

Project description

SCARCITY Framework

Scarcity-aware Causal Adaptive Resource-efficient Intelligence Training sYstem

An advanced machine learning framework for online, resource-constrained environments with real-time causal discovery, adaptive resource management, and federated learning capabilities.


Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • 4GB RAM minimum

Backend Setup

cd backend
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

Frontend Setup

cd scarcity-deep-dive
npm install
npm run dev

Access


Complete Documentation

→ View Complete Documentation Index

Quick Links


Key Features

Multi-Path Inference Engine (MPIE)

Discover causal relationships from streaming data automatically

  • Real-time causal graph discovery
  • Statistical validation with bootstrap resampling
  • Hypergraph representation

Dynamic Resource Governor (DRG)

Adapt to resource constraints dynamically

  • Real-time CPU/memory/GPU monitoring
  • PID-based control policies
  • Predictive resource forecasting

Federation Layer

Enable decentralized learning across organizations

  • Peer-to-peer model sharing
  • Multiple aggregation strategies (FedAvg, Weighted, Adaptive)
  • Differential privacy protection

Meta-Learning Agent

Transfer knowledge across domains and tasks

  • Cross-domain optimization
  • Prior knowledge extraction
  • Adaptive hyperparameter tuning

3D Simulation Engine

Visualize and explore causal hypergraphs

  • Interactive 3D visualization
  • Force-directed graph layout
  • Real-time updates

Architecture


Frontend (React) 
Dashboard | Engine | Federation | Domains | Visualization 

REST API

Backend (FastAPI) 
API Layer | ScarcityCoreManager | Domain Manager 

Event Bus

Scarcity Core Components 
Runtime Bus | MPIE | DRG | Federation | Meta | Simulation 


Project Structure

scace4/
backend/ # Python FastAPI backend
app/
api/v2/ # REST API endpoints
core/ # Business logic
main.py # FastAPI app
scripts/ # Utility scripts
tests/ # Test files

scarcity/ # Core ML library
runtime/ # Event bus
engine/ # MPIE orchestrator
governor/ # DRG
federation/ # Federation layer
meta/ # Meta-learning
simulation/ # 3D simulation

scarcity-deep-dive/ # React frontend
src/
pages/ # Page components
components/ # Reusable components
lib/ # API client
package.json

docs/ # Comprehensive documentation
01-product-overview.md
02-architecture.md
03-mathematical-foundations.md
04-core-algorithms.md
05-backend-implementation.md

Use Cases

Healthcare

Federated learning across hospitals without sharing patient data

Finance

Real-time fraud detection with adaptive resource allocation

Manufacturing

Predictive maintenance on edge devices with limited compute

Retail

Multi-domain learning for rapid adaptation to new markets


Technology Stack

Backend

  • Framework: FastAPI 0.115.0
  • Language: Python 3.11+
  • Async: asyncio
  • Validation: Pydantic
  • Numerical: NumPy

Frontend

  • Framework: React 18
  • Language: TypeScript
  • Build: Vite
  • UI: shadcn/ui
  • State: TanStack Query

Core Library

  • Language: Python
  • Algorithms: Custom implementations
  • Math: NumPy, SciPy

Performance

  • Data Ingestion: 100-500 windows/second
  • Causal Discovery: 50-200 candidate paths/second
  • API Latency: < 100ms (p95)
  • Resource Monitoring: 2 Hz
  • Memory Usage: 500MB - 2GB
  • CPU: 2-4 cores recommended

Testing

# Backend tests
cd backend
pytest tests/

# Frontend tests
cd scarcity-deep-dive
npm test

Documentation

For Developers

  1. Architecture Guide
  2. Backend Implementation
  3. API Reference

For Data Scientists

  1. Mathematical Foundations
  2. Core Algorithms
  3. Data Flow

For DevOps

  1. Deployment Guide
  2. Configuration
  3. Monitoring

Contributing

We welcome contributions! Please see our Development Guide for:

  • Code style and conventions
  • Git workflow
  • Adding new features
  • Testing requirements

License

[Add license information here]


Acknowledgments

Built with modern ML research and production best practices.


Support


Version: 2.0.0 Status: Production Ready Last Updated: December 3, 2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scarcity-1.0.0.tar.gz (144.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scarcity-1.0.0-py3-none-any.whl (184.0 kB view details)

Uploaded Python 3

File details

Details for the file scarcity-1.0.0.tar.gz.

File metadata

  • Download URL: scarcity-1.0.0.tar.gz
  • Upload date:
  • Size: 144.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for scarcity-1.0.0.tar.gz
Algorithm Hash digest
SHA256 abc0946b26f8eeb8bee70e003e191e66a3bd4fb8ba581cfcae6085d1e300f9d8
MD5 a26c1ae0c04b1049dbf9322832a9dae5
BLAKE2b-256 1f4d457d73caaad23807e93c196b85fb7125e95635a1a02b4f1d2e8d1a51ca19

See more details on using hashes here.

File details

Details for the file scarcity-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: scarcity-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 184.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for scarcity-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 333d1d5a2d94577b3aef855c8332c907a21cd190c7bb5f188237d46d23ce59a5
MD5 1905e25358b36a3ac08dedc44b64845c
BLAKE2b-256 9b4b5b70a464483785b0879e1d406aaa443b63147544a1fe271ac30893ea508a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page