Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Always write optimal Python code by finding the most optimized version with AI

NotificationsYou must be signed in to change notification settings

codeflash-ai/codeflash

Repository files navigation

Codeflash-banner

GitHub commit activityPyPI DownloadsPyPI Downloads

Codeflash is a general purpose optimizer for Python that helps you improve the performance of your Python code while maintaining its correctness.It uses advanced LLMs to generate multiple optimization ideas for your code, tests them to be correct and benchmarks them for performance. It then creates merge-ready pull requests containing the best optimization found, which you can review and merge.

How to use Codeflash -

  • Optimize an entire existing codebase by runningcodeflash --all
  • Automate optimizing allfuture code you will write by installing Codeflash as a GitHub action.
  • Optimize a Python workflowpython myscript.py end-to-end by runningcodeflash optimize myscript.py

Codeflash is used by top engineering teams atPydantic(PRs Merged),Roboflow(PRs Merged 1,PRs Merged 2),Unstructured(PRs Merged 1,PRs Merged 2),Langflow(PRs Merged) and many others to ship performant, expert level code.

Codeflash is great at optimizing AI Agents, Computer Vision algorithms, PyTorch code, numerical code, backend code or anything else you might write with Python.

Installation

To install Codeflash, run:

pip install codeflash

Add codeflash as a development time dependency if you are using package managers like uv or poetry.

Quick Start

  1. To configure Codeflash for a project, at the root directory of your project where the pyproject.toml file is located, run:

    codeflash init
    • It will ask you a few questions about your project like the location of your code and tests
    • Ask you to generate anAPI Key to access Codeflash's LLMs
    • Install aGitHub app to open Pull Requests on GitHub.
    • Ask if you want to setup a GitHub actions which will optimize all your future code.
    • The codeflash config is then saved in the pyproject.toml file.
  2. Optimize your entire codebase:

    codeflash --all

    This can take a while to run for a large codebase, but it will keep opening PRs as it finds optimizations.

  3. Optimize a script:

    codeflash optimize myscript.py

Documentation

For detailed installation and usage instructions, visit our documentation atdocs.codeflash.ai

Demo

  • Optimizing the performance of new code for a Pull Request through GitHub Actions. This lets you ship code quickly while ensuring it remains performant.
PR.Continuous.Optimization.mp4
  • Optiming a workflow end to end automatically withcodeflash optimize
codeflash.optimize.v2.mp4

Support

Join our community for support and discussions. If you have any questions, feel free to reach out to us using one of the following methods:

License

Codeflash is licensed under the BSL-1.1 License. See theLICENSE file for details.

About

Always write optimal Python code by finding the most optimized version with AI

Resources

Security policy

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp