A CLI to chat with LLMs (Groq/OpenAI etc.)
Project description
NeeCLI
A command-line interface (CLI) tool for chatting with Large Language Models (LLMs) using Groq and OpenAI APIs.
Features
- Multi-provider support: Chat with Groq and OpenAI models
- Interactive chat loop: Continuous conversation mode
- Conversation history: Save and load chat history
- Streaming responses: Real-time response streaming
- Flexible model selection: Choose from different LLM models
- Environment-based configuration: Secure API key management
Installation
Prerequisites
- Python 3.8 or higher
- A Groq or OpenAI API key
Install the package
# Clone the repository
git clone <repository-url>
cd NeeCLI
# Install dependencies
pip install -e .
Configuration
API Keys
You can set your API keys in several ways:
-
Environment variables:
export GROQ_API="your-groq-api-key" export OPENAI_API_KEY="your-openai-api-key"
-
.envfile (recommended):GROQ_API=your-groq-api-key OPENAI_API_KEY=your-openai-api-key
-
Interactive prompt: The tool will prompt you for the API key if not found.
Usage
Basic Commands
# Send a single message
neecli chat "Hello, how are you?"
# Start an interactive chat loop
neecli loop "Let's start a conversation"
# View conversation history
neecli history
# Clear conversation history
neecli clear
Advanced Options
# Use a specific model
neecli chat "Explain quantum computing" --model "openai/gpt-oss-20b"
# Adjust response randomness
neecli chat "Tell me a story" --temperature 0.9
# Use OpenAI instead of Groq
neecli chat "Hello" --provider openai --model "gpt-3.5-turbo"
# Interactive loop with custom settings
neecli loop "Start a coding session" --model "openai/gpt-oss-20b" --temperature 0.3 --provider groq
Interactive Chat Loop
When using the loop command, you can:
- Type your messages and press Enter
- Type
exitto quit the chat loop - Type
clearto clear conversation history - The conversation automatically clears after 20 messages to prevent context overflow
Available Models
Groq Models
openai/gpt-oss-20b(default)llama3-8b-8192llama3-70b-8192mixtral-8x7b-32768
OpenAI Models
gpt-3.5-turbogpt-4gpt-4-turbo
Development
Project Structure
NeeCLI/
├── NeeCLI/
│ ├── __init__.py
│ ├── cli.py # Main CLI implementation
│ ├── config.py # Configuration and API key management
│ ├── history.py # Conversation history management
│ └── main.py # Entry point
├── tests/
│ └── test_cli.py # Test suite
├── pyproject.toml # Project configuration
└── README.md
Running Tests
python -m pytest tests/
Building the Package
python -m build
Troubleshooting
Common Issues
- API Key Not Found: Make sure your API key is set in environment variables or
.envfile - Model Not Available: Check if the model name is correct for your provider
- Rate Limiting: Some models have rate limits; try again later
- Network Issues: Check your internet connection
Error Messages
Failed to initialize client: Check your API key and internet connectionModel not found: Verify the model name is correct for your providerRate limit exceeded: Wait before making more requests
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Support
For issues and questions, please open an issue on the GitHub repository.
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 neecli-0.3.0.tar.gz.
File metadata
- Download URL: neecli-0.3.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a031d0d3f555b6572c76b52ea7f323d4b27ceced93dae8ad815743e5e2ad606
|
|
| MD5 |
26e36ad6d9421a1023e9c4a554369130
|
|
| BLAKE2b-256 |
0cbd665fae51a55ba0591a020e6226e491c59bea3711f55e77cc61fc763b111a
|
File details
Details for the file neecli-0.3.0-py3-none-any.whl.
File metadata
- Download URL: neecli-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a3310e3b08ff81948f66efd963ac63fd3a3fc52d66e25728fb6f016cb6c8035
|
|
| MD5 |
638d366a33bcaa39e034ffd65e8ace00
|
|
| BLAKE2b-256 |
0489c4b298dbb6f0b9d2d155e885856d1e91806a8d575769fa004d558b7b2e7c
|