Introduction to ai-renamer
The ai-renamer project is an innovative Node.js command-line interface (CLI) that leverages advanced artificial intelligence models to intelligently rename files based on their content. Utilized by individuals aiming to organize their digital files more efficiently, this tool supports a variety of file formats, including videos and images, making file management effortless and time-efficient.
Key Features
-
AI-Driven Renaming: Uses models from platforms like Ollama and LM Studio, including popular ones like Llava, Gemma, and Llama, to understand and rename files based on content intelligently.
-
Broad Format Support: Capable of renaming various file types, ai-renamer can handle videos, images, and other file types, providing a flexible solution for digital file management.
-
Multiple Provider Support: Integrates with several provider options such as Ollama, LM Studio, and OpenAI, allowing users to select their preferred platform for running the naming algorithms.
Getting Started
To use ai-renamer, users need to have either the Ollama or LM Studio applications installed, along with at least one language model like Llava or Gemma. Additionally, for video file renaming, ffmpeg is necessary.
Users can run ai-renamer using NPX or by installing it globally via NPM:
npx ai-renamer /path
or
# Install it globally
npm install -g ai-renamer
# Run it
ai-renamer /path
Customization and Configuration
Provider Setup
-
Ollama: As the default provider, it doesn’t require any additional setup. Simply run the application, and it auto-selects the Llava model.
npx ai-renamer /path --provider=ollama --model=llava:13b
-
LM Studio: Set up LM Studio as the provider and the program will select the loaded model automatically.
npx ai-renamer /path --provider=lm-studio
-
OpenAI: For those using OpenAI, they need to include their API key. The CLI supports model selection with ease.
npx ai-renamer /path --provider=openai --api-key=OPENAI_API_KEY
Custom Ports
For users who require custom configurations, ai-renamer provides options to specify base URLs if using non-default ports with Ollama or LM Studio.
npx ai-renamer /path --provider=ollama --base-url=http://127.0.0.1:11434
Advanced Options
ai-renamer supports numerous command-line flags, allowing users to tailor their experience:
- Case Styling: Supports various case styles like camelCase, pascalCase, and snakeCase.
- Custom Prompting: Users can input custom prompts for the language models to guide the renaming process creatively.
- Subdirectory Inclusion: Decide whether to include files from subdirectories in the renaming process.
These configurations are saved on the user’s disk, ensuring consistency across uses without needing to reset options.
Contribution and Licensing
ai-renamer is open to contributions, encouraging users and developers to participate by reporting issues or contributing code improvements. The project is licensed under GPL-3.0, ensuring it remains free and open for use and modification by the community.
In summary, ai-renamer is a powerful tool designed for efficient and intelligent file renaming, tailored to the needs of modern digital organization. Whether for personal or professional use, it offers a flexible, AI-powered solution to keeping file names meaningful and organized.