Registry / testing / codeflash-benchmark

codeflash-benchmark

JSON →
library0.3.0pypypi✓ verified 85d ago

Pytest plugin for automatic code performance benchmarking and optimization, integrated with codeflash.ai. Current version 0.3.0, regular updates.

pip install codeflash-benchmark
INSTALL
IMPORT
SIG · CODEFLASH-BENCHMAR
C
codeflash-benchmark
testingpythonv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytest_benchmark
import codeflash_benchmark
import codeflash
Codeflash-benchmark exposes a pytest plugin; no direct API import needed.

Enable the plugin via pytest_plugins and run with --benchmark-only flag.

# Add to conftest.py or pytest.ini # pytest_plugins = ['codeflash_benchmark'] # Then run: pytest --benchmark-only import os if os.environ.get('CODEFLASH_API_KEY', ''): print('Benchmarking with codeflash.ai')
Debug
Known issues
gotchaEnsure CODEFLASH_API_KEY environment variable is set for remote optimization. Without it, benchmarking only runs locally.
fix
Set CODEFLASH_API_KEY in your environment.
affects: <0.3.0
deprecatedThe auto-optimization feature may be deprecated in future versions; check docs for manual optimization.
fix
Use explicit --benchmark-flags instead.
affects: >=0.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'codeflash_benchmark'
Wrong import or not installed.
fix
Install with: pip install codeflash-benchmark
usage: pytest [options] ... pytest: error: unrecognized arguments: --benchmark-only
Plugin not registered.
fix
Add 'pytest_plugins = ["codeflash_benchmark"]' to conftest.py or pytest.ini
Upgrade
Version history
0.3.0latest on PyPI · released Feb 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
Amazon
2
OpenAI (training)
1
Resources
codeflash-benchmark — pip install codeflash-benchmark · libregistry