Skip to main content

Universal model resource scheduler for AI applications

Project description

Self-Awakening-Scheduler

Universal model resource scheduler for AI applications — intelligently routes tasks to optimal models based on quality, cost, and availability.

Features

  • Smart Model Selection: Automatically selects the best model for each task based on quality, cost, and availability
  • Multi-Platform Support: Works with OpenRouter, Ollama, Moonshot, MiniMax, and any OpenAI-compatible API
  • Dynamic Model Discovery: Automatically discovers new models from OpenRouter and Ollama Cloud
  • Usage Tracking: Monitors model usage, costs, and provides optimization suggestions
  • Fallback Chains: Graceful degradation when preferred models are unavailable
  • Resource Profiles: Configurable resource limits, quality scores, and cost tracking

Quick Start

1. Installation

git clone https://github.com/63894696/Self-Awakening-Scheduler.git
cd Self-Awakening-Scheduler
pip install -r requirements.txt

2. Configuration

Copy the example configuration files and customize with your API keys:

cp config/model_pool.example.json config/model_pool.json
cp config/resource_profiles.example.json config/resource_profiles.json

Edit config/model_pool.json with your API keys and model preferences:

{
  "models": {
    "your-model-id": {
      "provider": "your-provider",
      "base_url": "https://api.example.com/v1",
      "key_env": "YOUR_API_KEY",
      "payment_type": "free|subscription|payasyougo",
      "context_window": 131072,
      "strengths": ["code", "reasoning"],
      "cost_per_mtok": "free"
    }
  }
}

3. Usage

from src.smart_scheduler import SmartScheduler

# Initialize scheduler
scheduler = SmartScheduler()

# Select optimal model for a task
result = scheduler.select_optimal_model("complex", "Refactor 15 files with OAuth2")
print(f"Selected model: {result['selected_model']}")
print(f"Platform: {result['platform']}")
print(f"Score: {result['score']}")

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    User Application                         │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│                 Smart Scheduler                             │
│  - Task classification (simple/medium/complex/gui/voice)   │
│  - Model scoring (quality + cost + availability + usage)   │
│  - Optimal selection with fallback chains                  │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│                 Model Pool Manager                          │
│  - Dynamic model discovery (OpenRouter, Ollama)            │
│  - Availability checking                                    │
│  - Resource limit tracking                                  │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│                 Model Providers                             │
│  - OpenRouter (free models)                                │
│  - Ollama Cloud (free models)                              │
│  - Moonshot (Kimi K3)                                      │
│  - MiniMax (TTS/Video)                                     │
│  - Custom OpenAI-compatible APIs                           │
└─────────────────────────────────────────────────────────────┘

Documentation

Configuration

Model Pool Configuration

config/model_pool.json defines your available models:

{
  "version": "0.1",
  "updated": "2026-07-21",
  "models": {
    "agnes-2.0-flash": {
      "provider": "AgnesAI",
      "base_url": "https://apihub.agnes-ai.com/v1",
      "key_env": "AGNES_API_KEY",
      "payment_type": "subscription",
      "context_window": 131072,
      "strengths": ["code-review", "simple-routing"],
      "cost_per_mtok": "free-monthly"
    }
  },
  "routing_rules": {
    "simple": {"preferred_router": "agnes-2.0-flash"},
    "complex": {"preferred_router": "kimi-k3-payg"}
  }
}

Resource Profiles Configuration

config/resource_profiles.json defines resource limits and quality scores:

{
  "resource_profiles": {
    "openrouter": {
      "platform": "OpenRouter",
      "models": {
        "nvidia/nemotron-3-ultra-550b-a55b:free": {
          "status": "available",
          "quality_score": 7,
          "strengths": ["large-model", "reasoning"],
          "cost": "free"
        }
      }
    }
  }
}

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License — see LICENSE for details.

Acknowledgments

  • Inspired by the need for intelligent model routing in AI applications
  • Built for the AI community to optimize model usage and costs
  • Special thanks to OpenRouter and Ollama for providing free model access

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

self_awakening_scheduler-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

self_awakening_scheduler-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file self_awakening_scheduler-0.1.0.tar.gz.

File metadata

File hashes

Hashes for self_awakening_scheduler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6bc1737db6b93d0006083954fb33164244fc5be1dd02e761d5a777518f83c436
MD5 aeef09540b5aabb24639ef73bddd10a8
BLAKE2b-256 04230198f1fdaa27667629d7f31452f1d024b345d60cd1924fc03fc0a385d566

See more details on using hashes here.

File details

Details for the file self_awakening_scheduler-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for self_awakening_scheduler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a9d5728ca1c00a4a0452f7df214230f78ed3be869615253abf95e2516546e49
MD5 77bfae4783dff2ae5a3ac1793fcf64c5
BLAKE2b-256 6dd22fc2f17fd3ac68d61c6d1a142d9c333ba3d769e75b8f9c36091a888aaa9a

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