codeflash
Client for codeflash.ai - automatic code performance optimization, powered by AI
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you have an active Codeflash.ai account and API key, want LLM-assisted performance optimization integrated into your workflow, and are willing to review and merge AI-generated pull requests. The tool is actively maintained, has low install friction, and carries no known vulnerabilities. The main friction is the unclear license metadata—verify the BSL-1.1 terms apply to your use case before relying on it in production. The 38 runtime dependencies are substantial but necessary for the feature set.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >=3.9.
- Codeflash init requires an API key from codeflash.ai and optionally a GitHub app installation to open pull requests.
- Low install friction with a pure-Python wheel.
License · maintenance · safety
(unclear) — License treatment is unclear—no SPDX identifier or raw license text is available in the package metadata, though the description mentions BSL-1.1. Verify the actual license terms before committing to production use.
last release 2026-05-30 (76 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 191,944 downloads/mo, #9,872 on PyPI
Alternatives
Verify before relying
pip install codeflash
codeflash init
codeflash --all- Whether the BSL-1.1 license mentioned in the description is the actual license or if the unclear metadata reflects a different licensing model.
- Whether the 38 runtime dependencies are all required at install time or if some are optional for specific features.
- Performance and cost implications of running LLM-based optimization on large codebases.
What it is and what it does
Codeflash is a command-line client for an AI-powered code optimization service. It analyzes your Python code, generates multiple optimization candidates using LLMs, tests them for correctness, benchmarks them for performance, and opens pull requests with the best improvements. You configure it once with `codeflash init` (which asks for an API key and optional GitHub app setup), then run `codeflash --all` to optimize an entire codebase, `codeflash optimize myscript.py` for a single file, or set up GitHub Actions to optimize all future pull requests automatically.
The tool depends on a large set of runtime libraries for code analysis (libcst, jedi), testing (pytest and variants), profiling (line-profiler, memray), and communication with the Codeflash service (requests, posthog, sentry-sdk). It's designed for teams shipping Python code—AI agents, computer vision, PyTorch, numerical, and backend workloads—where performance matters and code review is already part of the workflow.
Use it for
- Optimize an entire existing Python codebase in one pass to find and merge performance improvements across all modules.
- Automatically optimize new code in pull requests via GitHub Actions before it ships, ensuring performance without manual profiling.
- Profile and optimize a single Python script or workflow end-to-end without manual benchmarking or code review.
- Integrate performance optimization into CI/CD so that performance regressions are caught and fixed before merge.
- Explore multiple optimization strategies for hot code paths and let the tool rank them by actual benchmark results.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you have an active Codeflash.ai account and API key, want LLM-assisted performance optimization integrated into your workflow, and are willing to review and merge AI-generated pull requests. The tool is actively maintained, has low install friction, and carries no known vulnerabilities. The main friction is the unclear license metadata—verify the BSL-1.1 terms apply to your use case before relying on it in production. The 38 runtime dependencies are substantial but necessary for the feature set.
Install
codeflash on PyPI
Before you install
Low install friction with a pure-Python wheel. Requires 38 runtime dependencies including testing frameworks (pytest, pytest-asyncio, pytest-memray), profiling tools (line-profiler, memray), and LLM/analysis libraries (jedi, libcst, crosshair-tool). Active maintenance with latest release 76 days ago.
Requires Python >=3.9. Codeflash init requires an API key from codeflash.ai and optionally a GitHub app installation to open pull requests.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available in the package metadata, though the description mentions BSL-1.1. Verify the actual license terms before committing to production use.
Quickstart
pip install codeflash
codeflash init
codeflash --all
Verify before relying
- Whether the BSL-1.1 license mentioned in the description is the actual license or if the unclear metadata reflects a different licensing model.
- Whether the 38 runtime dependencies are all required at install time or if some are optional for specific features.
- Performance and cost implications of running LLM-based optimization on large codebases.
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 38 packagesattrsclickcodeflash-benchmarkcoveragecrosshair-tooldillfilelockgitpythonhumanizeinquirerisortjedijunitparserlibcstline-profilerlxmlmemrayparameterizedplatformdirsposthogpydanticpyglspytest-asynciopytest-memraypytest-timeoutpytestrequestsrichsentry-sdktomlkit |
| Maintenance | Actively maintained 76 days since the last release |
| First released | |
| Downloads | 191,944 / month, #9,872 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: codeflash-0.20.6-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python code performance optimization”
- codeflashCodeflash is a CLI tool that uses LLMs to automatically generate,…
- codeflash-benchmarkA pytest plugin that adds benchmarking capabilities for CodeFlash's…
- scaleneScalene profiles Python code to measure CPU, GPU, and memory…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also codeflash-benchmark · lfx · gepa · opt-einsum-fx · flashoptim · inference-cli · tensorflow-model-optimization · FLAML · litdata · onnxslim