CPUFreqRizer is a Python package that determines the optimal CPU scaling configuration for your system based on your workload. It takes user input, such as task type, expected load, and performance requirements, and generates a structured response with recommended CPU scaling policies.
pip install cpufreqizerCPUFreqRizer uses an LLM (Large Language Model) to generate a structured response with CPU scaling recommendations. The user provides details about their workload, and the package returns a list of recommended CPU scaling policies, including the appropriate governor and kernel parameters.
from cpufreqizer import cpufreqizer
response = cpufreqizer(user_input={"task_type": "cpu-intensive", "expected_load": 0.8, "performance_requirements": "high"})By default, CPUFreqRizer uses the llm7 LLM from the langchain_llm7 package. This is a free-tier LLM with sufficient rate limits for most use cases. You can safely pass your own llm instance (based on these docs) if you want to use a different LLM. For example, to use the openai LLM:
from langchain_openai import ChatOpenAI
from cpufreqizer import cpufreqizer
llm = ChatOpenAI()
response = cpufreqizer(user_input={"task_type": "cpu-intensive", "expected_load": 0.8, "performance_requirements": "high"}, llm=llm)To use a different LLM with a higher rate limit, you can obtain a free API key on the llm7.io website. You can then pass this API key via environment variable LLM7_API_KEY or directly to the cpufreqizer function:
cpufreqizer(user_input={"task_type": "cpu-intensive", "expected_load": 0.8, "performance_requirements": "high"}, api_key="your_api_key")You can find the source code for this package on GitHub.
If you have any questions or need help with using the package, please don't hesitate to reach out to me at hi@euegne.plus.
If you use the cpufreqizer package in your research, please cite it as follows:
E. Evstafev, "CPUFreqRizer: A Python Package for Determining Optimal CPU Scaling Configuration"