经 AI Skill Hub 精选评估,FasterPy 获评「推荐使用」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
FasterPy 是一款基于 Python 开发的开源工具,专注于 AI、LLM、代码优化 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
FasterPy 是一款基于 Python 开发的开源工具,专注于 AI、LLM、代码优化 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install fasterpy
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install fasterpy
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/WuYue22/FasterPy
cd FasterPy
pip install -e .
# 验证安装
python -c "import fasterpy; print('安装成功')"
# 命令行使用
fasterpy --help
# 基本用法
fasterpy input_file -o output_file
# Python 代码中调用
import fasterpy
# 示例
result = fasterpy.process("input")
print(result)
# fasterpy 配置文件示例(config.yml) app: name: "fasterpy" debug: false log_level: "INFO" # 运行时指定配置文件 fasterpy --config config.yml # 或通过环境变量配置 export FASTERPY_API_KEY="your-key" export FASTERPY_OUTPUT_DIR="./output"
[//]: # ()
------
Follow these steps to set up the environment for <span style="font-family: Consolas;">FasterPy</span>:
conda create -n fsp python=3.11
conda activate fsp
pip install -r requirements.txt
We modified the evaluation code from madaan/pie-perf: Training language models to make programs faster, and the usage is similar.
Step 1. Save the generations in a jsonl file with the following fields:
{
"slow_code_col": "the column name for the input code",
"model_generated_potentially_faster_code_col": "slow_code_col after applying awesome_optimization. This is the code that will be evaluated. You can also provide a list of different candidates here, and the evaluation will be done for each candidate"
}
Step 2. Next, we need to provide the path to the file with some metadata. We call it the reference_file but providing references are optional. The main purpose of this file is to provide information like the language of the code, the problem id, etc. The file should have slow_code_col (same as the generations file) and problem_id. We join the generations file and the references file on the slow_code_col to get the problem id.
Step 3. Finally, we need to provide the path to the file with the actual test cases. We call it the inputs_outputs_basepath. This is a directory with the following structure:
inputs_outputs_basepath/{problem_id}/{inputs, outputs}.txt where {inputs, outputs}.txt are the input and output files for the problem with id problem_id. The input and output are plain text files. Each program is fed inputs.txt and the output is compared with outputs.txt.
Step 4. In addition to these, we need to provide some information about the run. Specifically, the number of times each program should be run, the number of programs to evaluate, the timeout, and so on.
We wrap all of this information is provided in a yaml file sample_eval_config.yaml. Here is an example:
model_generated_outputs_path: "to_be_eval/test-qw2.5-7b-i.jsonl"
inputs_outputs_basepath: "codenet/public_test_cases"
reference_file_path: "py_reference.jsonl"
output_report_file_path: "eval-results/test-qw2.5-7b-i-report.jsonl"
language: "python"
num_problems_to_evaluate: -1
num_trials: 4
ignore_first_k: 1
max_time_per_run: 3
temp_dir: null
model_generated_potentially_faster_code_col: "model_generated_potentially_faster_code_col"
slow_code_col: "slow_code_col"
reference_code_col: "reference_code_col"
is_prompt_based: false
cpu_number: 1 Step 5. Finally, we can run the evaluation. We provide a script for this: src/codenet_eval/run_eval.py. The script takes the yaml file as input. Here is an example:
python src/codenet_eval/run_eval.py --eval_config eval/sample_eval_config.yaml
高效的LLM代码优化框架
该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
AI Skill Hub 点评:FasterPy 的核心功能完整,质量良好。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | FasterPy |
| 原始描述 | 开源AI工具:An LLM-based Code Execution Efficiency Optimization Framework。⭐7 · Python |
| Topics | AILLM代码优化 |
| GitHub | https://github.com/WuYue22/FasterPy |
| 语言 | Python |
收录时间:2026-05-25 · 更新时间:2026-05-30 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。