CodeFlash
AI that finds and fixes performance bottlenecks in Python code.
About
CodeFlash is an AI-powered code optimizer that automatically improves the performance of Python code while preserving correctness. It discovers optimization opportunities across a codebase, generates candidates with large language models, verifies them by executing tests, and benchmarks the results.
Each verified optimization is opened as a pull request with benchmark evidence, and it can run continuously through CI to keep optimizing as the codebase evolves. A tracer mode profiles real workflows to find hot paths worth optimizing. It is distributed via PyPI and the codeflash-ai/codeflash GitHub repository under the BSL-1.1 license.
What it can do
- AI-generated performance optimizations
- Correctness verification through test execution
- Pull requests with benchmark evidence
- Continuous optimization via CI
Setup
Run pip install codeflash, then codeflash init in your project and optimize with codeflash --all.
Prerequisites
A Python project with an existing test suite for correctness verification.
Use cases
Works with
Trust score — 8/10
Scored 8/10 (verified tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 110; Trending score 76/100 from researcher assessment.
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.