hashiruAI / src /manager /utils /runtime_selector.py
helloparthshah's picture
refactor
2f85c93
raw
history blame
318 Bytes
import platform
import GPUtil
from dotenv import load_dotenv
load_dotenv()
def detect_runtime_environment():
os_type = platform.system().lower()
gpus = GPUtil.getGPUs()
if gpus:
return "gpu"
elif os_type in ["darwin", "linux"]:
return "cpu-local"
else:
return "cloud-only"