AI assistant CLI tool for multiple providers
Project description
aineed
A minimal CLI tool for interacting with multiple AI providers (OpenAI, Anthropic, TogetherAI, OpenRouter) with a unified interface.
Features
- 🤖 Multiple AI Provider Support
- OpenAI (text and image generation with DALL-E 3)
- Anthropic (Claude models)
- TogetherAI (Llama and FLUX models)
- OpenRouter (various models)
- 🔄 Streaming Support for Text Generation
- 📁 File Input/Output with Prompt Prefixing
- 🎨 Image Generation with Automatic Timestamped Filenames
- 🔒 Local API Key Management
Prerequisites
- Python 3.7 or higher
- Rust toolchain (install from https://rustup.rs/)
Using pip
# Install Rust first if you haven't already
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
pip install aineed
Install without needing rust COMING SOON~
Support
As a full-time student, your support would be greatly appreciated!
- CashApp: $Nbiish
- Venmo: @Nbiish
- Linktree: https://linktr.ee/nbiish
Upcoming Features
We are excited to announce that future releases of aineed will include:
-
Google Models and Enhanced Capabilities: Integrate with Google's extensive AI models to provide even more powerful and diverse functionalities.
-
Voice and Audio Input/Output: Enable voice commands and audio responses for a more interactive and seamless user experience.
Stay tuned for these and more exciting updates!
Configuration
Set your API keys:
# OpenAI
aineed --set-openai "your-api-key"
# Anthropic
aineed --set-anthropic "your-api-key"
# TogetherAI
aineed --set-togetherai "your-api-key"
# OpenRouter
aineed --set-openrouter "your-api-key"
Usage
Basic Text Generation
# Default model (togetherai:meta-llama/Llama-3.3-70b-instruct-turbo)
aineed -p "Who are the Anishinaabe?"
# Using OpenAI
aineed openai:gpt-3.5-turbo -p "who are the Anishinaabe?"
# Using OpenRouter
aineed openrouter:google/gemini-exp-1206:free -p "who are the Anishinaabe?" -o Anishinaabe.txt
Image Generation
# Using OpenAI DALL-E 3 (saves as dall-e-3_TIMESTAMP.png)
aineed openai:dall-e-3 -i -p "Cyberpunk Nanaboozhoo"
# Using TogetherAI FLUX (with custom output name)
aineed togetherai:black-forest-labs/FLUX.1-schnell -i -p "Cyberpunk Nanaboozhoo" -o cyberpunk-nanaboozhoo.png
File Processing with Prompts
When using a file input with -f, you can provide a prompt with -p that will be prepended to the file content:
# Process a file with a specific instruction
aineed openai:gpt-4o -f story.txt -p "Take significant text and make it hashtags" -o story_optimized.txt
The API request will be formatted like so when using -p and -f:
USER PROMPT:
<your prompt>
FILE CONTENT:
<file content>
Streaming and Token Control
# Stream the response
aineed openai:gpt-4o-turbo -s -p "Tell me a story about Nanaboozhoo and the rabbits"
# Control max tokens and temperature
aineed openrouter:google/gemini-2.0-flash-exp --temp 0.9 -t 999 -p "Tell me a Nanaboozhoo fantasy adventure"
Setting Default Model
# Set a new default model
aineed -d "togetherai:meta-llama/Llama-3.3-70b-instruct-turbo"
Additional Examples of Use
aineed openai:gpt-4o -t 444 -p "Short story about Nanaboozhoo" -o nanaboozhoo.txt
cat nanaboozhoo.txt | aineed openrouter:google/gemini-2.0-flash-exp -p "Rephrase the story to be extra silly" -o nanaboozhoo-silly.txt
aineed anthropic:claude-3.5-sonnet-latest -s -f nanaboozhoo-silly.txt -p "End every sentence with hashtags" -o nanaboozhoo-silly-hashtags.txt
Translating Text
Translate a sentence from English to Spanish using Anthropic's Claude model:
aineed anthropic:claude-3.5-sonnet-latest -p "Translate the following sentence to Spanish: 'Artificial intelligence is transforming the world.'"
Creating Detailed Images
Generate a high-resolution image of a futuristic cityscape with TogetherAI's FLUX model:
aineed togetherai:black-forest-labs/FLUX.1-schnell -i -p "Create a high-resolution image of Cyberpunk Nanaboozhoo" -o cyberpunk_nanaboozhoo.png
Automating File Processing
for file in reports/*.txt; do
aineed openrouter:google/gemini-2.0-flash-exp -f "$file" -p "Summarize the key points of the following report." -o "summaries/$(basename "$file")"
done
Streaming Long-Form Content
Stream the generation of a comprehensive guide on machine learning with controlled token usage:
aineed openai:gpt-4o-mini -s -t 1500 -p "Write a comprehensive guide on machine learning, including definitions, algorithms, and applications."
Setting and Using Default Models
Set a default model and generate content without specifying the provider each time:
# Set the default model to OpenAI's GPT-4
aineed -d "openai:gpt-4o-mini"
# Now generate content using the default model
aineed -p "Describe the impact of climate change on global ecosystems and how indigenous people protect the majority of remaining healthy ecosystems." -o climate_change_impact.txt
Integrating with Other Tools
Use aineed in a shell script to automate the generation and processing of content:
#!/bin/bash
# Generate an article
aineed openai:gpt-4 -p "Write an article about the benefits of renewable energy." -o article.txt
# Summarize the article
aineed openai:gpt-4o -f article.txt -p "Summarize the main points of this article." -o summary.txt
# Log the actions
echo "Article and summary generated on $(date)" >> generation.log
End Generation Here
## Error Handling
The tool provides detailed error messages from providers to help troubleshoot:
- API key issues
- Rate limiting
- Connection problems
- Model access restrictions
- File I/O errors
## License
MIT License - see [LICENSE](LICENSE) for details
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
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 aineed-0.1.11.tar.gz.
File metadata
- Download URL: aineed-0.1.11.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28654abf370fa00dbf6ee26c1328ab784ad8c2f3a7b5b0cadf78b696f372423b
|
|
| MD5 |
77e9b02e2fe5fb94717fb793b2e4eb82
|
|
| BLAKE2b-256 |
499324763816c1809dd6dc70d213a2239a6b11b868930221067a1a1451c6cd72
|
File details
Details for the file aineed-0.1.11-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: aineed-0.1.11-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e75bceb4ba97eaa79c112b6e1d35bc5953e76b4aa69a7d09d2f9c1d979ca2ecf
|
|
| MD5 |
43b1f4301380eac1afe710e06abcb3f0
|
|
| BLAKE2b-256 |
ba04f19543edfd85dab89bb90e6c4b81d7d682d956806849b0188ee34abf6e3f
|