Universal optimization system for AI coding assistants
Project description
AI Token Optimizer CLI
Command-line tool for optimizing prompts sent to AI coding assistants.
Installation
pip install ai-optimize
Or install from source:
pip install -e .
Usage
Basic optimization
# Use default optimization (lite mode)
ai-opt "fix the bug in auth.py"
# Use ultra mode for maximum savings
ai-opt --mode ultra "add error handling"
# Use verbose mode for detailed explanations
ai-opt --mode verbose "explain this algorithm"
Dry run
Preview the optimized prompt without executing:
ai-opt --dry-run "refactor this function"
Statistics
# Show usage statistics
ai-opt stats
# Show today's statistics
ai-opt stats --today
# Export statistics
ai-opt stats --export json
ai-opt stats --export csv
Configuration
# Create a config file in the current directory
ai-opt config init
# Create a global config file
ai-opt config init --global
# Show current configuration
ai-opt config show
# Validate configuration
ai-opt config validate
Tool management
# List supported tools
ai-opt tools list
# Detect available tools
ai-opt tools detect
Optimization modes
| Mode | Savings | Description |
|---|---|---|
| ultra | 60-80% | Code only, no explanations |
| lite | 40-60% | Code-first with brief explanations |
| verbose | 0-20% | Full explanations and context |
Configuration file
Create .ai-optimize.yml in your project root:
version: "1.0"
optimization:
mode: "lite"
rules:
skip_preamble: true
skip_postamble: true
code_first: true
max_explanation_length: 50
context:
exclude_patterns:
- "node_modules/**"
- "dist/**"
tracking:
enabled: true
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ai_optimize-0.1.1.tar.gz
(19.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_optimize-0.1.1.tar.gz.
File metadata
- Download URL: ai_optimize-0.1.1.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8a212451e9f67a397cb2c57a7ed58b904583a4a93c994816ad0d8919bc3bb09
|
|
| MD5 |
52da9089a0bd4334aa4d56277d1d0040
|
|
| BLAKE2b-256 |
b8c70e54893a251729305117353cdad7f14eabaef3db9c21dd9317d51a64ad38
|
File details
Details for the file ai_optimize-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ai_optimize-0.1.1-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e32542ade0217bb46f8600c09f6ae7ad237df5f3d34d31d850c6a7f2e676c08
|
|
| MD5 |
af18b694661925e8b7f098632dea7641
|
|
| BLAKE2b-256 |
c9298069f5d4382c2c53cf95121e90c76ff7da2da7ab6796d066fc7b49829a3b
|