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
- Methodology — How the scheduler works
- Integration Guide — How to integrate into your project
- Examples — Usage examples and best practices
- API Reference — Complete API 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file self_awakening_scheduler-0.1.0.tar.gz.
File metadata
- Download URL: self_awakening_scheduler-0.1.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bc1737db6b93d0006083954fb33164244fc5be1dd02e761d5a777518f83c436
|
|
| MD5 |
aeef09540b5aabb24639ef73bddd10a8
|
|
| BLAKE2b-256 |
04230198f1fdaa27667629d7f31452f1d024b345d60cd1924fc03fc0a385d566
|
File details
Details for the file self_awakening_scheduler-0.1.0-py3-none-any.whl.
File metadata
- Download URL: self_awakening_scheduler-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a9d5728ca1c00a4a0452f7df214230f78ed3be869615253abf95e2516546e49
|
|
| MD5 |
77bfae4783dff2ae5a3ac1793fcf64c5
|
|
| BLAKE2b-256 |
6dd22fc2f17fd3ac68d61c6d1a142d9c333ba3d769e75b8f9c36091a888aaa9a
|