Lot's of changes. None breaking. v3.0.0-b3
This commit is contained in:
141
README.md
141
README.md
@@ -1,19 +1,23 @@
|
||||
# oAI - OpenRouter AI Chat Client
|
||||
# oAI - Open AI Chat Client
|
||||
|
||||
A powerful, modern **Textual TUI** chat client for OpenRouter API with **MCP (Model Context Protocol)** support, enabling AI to access local files and query SQLite databases.
|
||||
A powerful, modern **Textual TUI** chat client with **multi-provider support** (OpenRouter, Anthropic, OpenAI, Ollama) and **MCP (Model Context Protocol)** integration, enabling AI to access local files and query SQLite databases.
|
||||
|
||||
## Features
|
||||
|
||||
### Core Features
|
||||
- 🖥️ **Modern Textual TUI** with async streaming and beautiful interface
|
||||
- 🤖 Interactive chat with 300+ AI models via OpenRouter
|
||||
- 🔄 **Multi-Provider Support** - OpenRouter, Anthropic (Claude), OpenAI (ChatGPT), Ollama (local)
|
||||
- 🤖 Interactive chat with 300+ AI models across providers
|
||||
- 🔍 Model selection with search, filtering, and capability icons
|
||||
- 💾 Conversation save/load/export (Markdown, JSON, HTML)
|
||||
- 📎 File attachments (images, PDFs, code files)
|
||||
- 💰 Real-time cost tracking and credit monitoring
|
||||
- 💰 Real-time cost tracking and credit monitoring (OpenRouter)
|
||||
- 🎨 Dark theme with syntax highlighting and Markdown rendering
|
||||
- 📝 Command history navigation (Up/Down arrows)
|
||||
- 🌐 Online mode (web search capabilities)
|
||||
- 🌐 **Universal Online Mode** - Web search for ALL providers:
|
||||
- **Anthropic Native** - Built-in search with automatic citations ($0.01/search)
|
||||
- **DuckDuckGo** - Free web scraping (all providers)
|
||||
- **Google Custom Search** - Premium search option
|
||||
- 🧠 Conversation memory toggle
|
||||
- ⌨️ Keyboard shortcuts (F1=Help, F2=Models, Ctrl+S=Stats)
|
||||
|
||||
@@ -36,7 +40,11 @@ A powerful, modern **Textual TUI** chat client for OpenRouter API with **MCP (Mo
|
||||
## Requirements
|
||||
|
||||
- Python 3.10-3.13
|
||||
- OpenRouter API key ([get one here](https://openrouter.ai))
|
||||
- API key for your chosen provider:
|
||||
- **OpenRouter**: [openrouter.ai](https://openrouter.ai)
|
||||
- **Anthropic**: [console.anthropic.com](https://console.anthropic.com)
|
||||
- **OpenAI**: [platform.openai.com](https://platform.openai.com)
|
||||
- **Ollama**: No API key needed (local server)
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -83,28 +91,111 @@ pip install -e .
|
||||
# Start oAI (launches TUI)
|
||||
oai
|
||||
|
||||
# Start with specific provider
|
||||
oai --provider anthropic
|
||||
oai --provider openai
|
||||
oai --provider ollama
|
||||
|
||||
# Or with options
|
||||
oai --model gpt-4o --online --mcp
|
||||
oai --provider openrouter --model gpt-4o --online --mcp
|
||||
|
||||
# Show version
|
||||
oai version
|
||||
```
|
||||
|
||||
On first run, you'll be prompted for your OpenRouter API key.
|
||||
On first run, you'll be prompted for your API key. Configure additional providers anytime with `/config`.
|
||||
|
||||
### Enable Web Search (All Providers)
|
||||
|
||||
```bash
|
||||
# Using Anthropic native search (best quality, automatic citations)
|
||||
/config search_provider anthropic_native
|
||||
/online on
|
||||
|
||||
# Using free DuckDuckGo (works with all providers)
|
||||
/config search_provider duckduckgo
|
||||
/online on
|
||||
|
||||
# Using Google Custom Search (requires API key)
|
||||
/config search_provider google
|
||||
/config google_api_key YOUR_KEY
|
||||
/config google_search_engine_id YOUR_ID
|
||||
/online on
|
||||
```
|
||||
|
||||
### Basic Commands
|
||||
|
||||
```bash
|
||||
# In the TUI interface:
|
||||
/provider # Show current provider or switch
|
||||
/provider anthropic # Switch to Anthropic (Claude)
|
||||
/provider openai # Switch to OpenAI (ChatGPT)
|
||||
/provider ollama # Switch to Ollama (local)
|
||||
/model # Select AI model (or press F2)
|
||||
/online on # Enable web search
|
||||
/help # Show all commands (or press F1)
|
||||
/mcp on # Enable file/database access
|
||||
/stats # View session statistics (or press Ctrl+S)
|
||||
/config # View configuration settings
|
||||
/credits # Check account credits
|
||||
/credits # Check account credits (shows API balance or console link)
|
||||
Ctrl+Q # Quit
|
||||
```
|
||||
|
||||
## Web Search
|
||||
|
||||
oAI provides universal web search capabilities for all AI providers with three options:
|
||||
|
||||
### Anthropic Native Search (Recommended for Anthropic)
|
||||
|
||||
Anthropic's built-in web search API with automatic citations:
|
||||
|
||||
```bash
|
||||
/config search_provider anthropic_native
|
||||
/online on
|
||||
|
||||
# Now ask questions requiring current information
|
||||
What are the latest developments in quantum computing?
|
||||
```
|
||||
|
||||
**Features:**
|
||||
- ✅ **Automatic citations** - Claude cites its sources
|
||||
- ✅ **Smart searching** - Claude decides when to search
|
||||
- ✅ **Progressive searches** - Multiple searches for complex queries
|
||||
- ✅ **Best quality** - Professional-grade results
|
||||
|
||||
**Pricing:** $10 per 1,000 searches ($0.01 per search) + token costs
|
||||
|
||||
**Note:** Only works with Anthropic provider (Claude models)
|
||||
|
||||
### DuckDuckGo Search (Default - Free)
|
||||
|
||||
Free web scraping that works with ALL providers:
|
||||
|
||||
```bash
|
||||
/config search_provider duckduckgo # Default
|
||||
/online on
|
||||
|
||||
# Works with Anthropic, OpenAI, Ollama, and OpenRouter
|
||||
```
|
||||
|
||||
**Features:**
|
||||
- ✅ **Free** - No API key or costs
|
||||
- ✅ **Universal** - Works with all providers
|
||||
- ✅ **Privacy-friendly** - Uses DuckDuckGo
|
||||
|
||||
### Google Custom Search (Premium Option)
|
||||
|
||||
Google's Custom Search API for high-quality results:
|
||||
|
||||
```bash
|
||||
/config search_provider google
|
||||
/config google_api_key YOUR_GOOGLE_API_KEY
|
||||
/config google_search_engine_id YOUR_SEARCH_ENGINE_ID
|
||||
/online on
|
||||
```
|
||||
|
||||
Get your API key: [Google Custom Search API](https://developers.google.com/custom-search/v1/overview)
|
||||
|
||||
## MCP (Model Context Protocol)
|
||||
|
||||
MCP allows the AI to interact with your local files and databases.
|
||||
@@ -184,11 +275,18 @@ MCP allows the AI to interact with your local files and databases.
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/config` | View settings |
|
||||
| `/config api` | Set API key |
|
||||
| `/config provider <name>` | Set default provider |
|
||||
| `/config openrouter_api_key` | Set OpenRouter API key |
|
||||
| `/config anthropic_api_key` | Set Anthropic API key |
|
||||
| `/config openai_api_key` | Set OpenAI API key |
|
||||
| `/config ollama_base_url` | Set Ollama server URL |
|
||||
| `/config search_provider <provider>` | Set search provider (anthropic_native/duckduckgo/google) |
|
||||
| `/config google_api_key` | Set Google API key (for Google search) |
|
||||
| `/config online on\|off` | Set default online mode |
|
||||
| `/config model <id>` | Set default model |
|
||||
| `/config stream on\|off` | Toggle streaming |
|
||||
| `/stats` | Session statistics |
|
||||
| `/credits` | Check credits |
|
||||
| `/credits` | Check credits (OpenRouter) |
|
||||
|
||||
## CLI Options
|
||||
|
||||
@@ -196,9 +294,10 @@ MCP allows the AI to interact with your local files and databases.
|
||||
oai [OPTIONS]
|
||||
|
||||
Options:
|
||||
-p, --provider TEXT Provider to use (openrouter/anthropic/openai/ollama)
|
||||
-m, --model TEXT Model ID to use
|
||||
-s, --system TEXT System prompt
|
||||
-o, --online Enable online mode
|
||||
-o, --online Enable online mode (OpenRouter only)
|
||||
--mcp Enable MCP server
|
||||
-v, --version Show version
|
||||
--help Show help
|
||||
@@ -280,7 +379,23 @@ pip install -e . --force-reinstall
|
||||
|
||||
## Version History
|
||||
|
||||
### v3.0.0 (Current)
|
||||
### v3.0.0-b3 (Current - Beta 3)
|
||||
- 🔄 **Multi-Provider Support** - OpenRouter, Anthropic (Claude), OpenAI (ChatGPT), Ollama (local)
|
||||
- 🔌 **Provider Switching** - Switch between providers mid-session with `/provider`
|
||||
- 🧠 **Provider Model Memory** - Remembers last used model per provider
|
||||
- ⚙️ **Provider Configuration** - Separate API keys for each provider
|
||||
- 🌐 **Universal Web Search** - Three search options for all providers:
|
||||
- **Anthropic Native** - Built-in search with citations ($0.01/search)
|
||||
- **DuckDuckGo** - Free web scraping (default)
|
||||
- **Google Custom Search** - Premium option
|
||||
- 🎨 **Enhanced Header** - Shows current provider and model
|
||||
- 📊 **Updated Config Screen** - Shows provider-specific settings
|
||||
- 🔧 **Command Dropdown** - Added `/provider` commands for discoverability
|
||||
- 🎯 **Auto-Scrolling** - Chat window auto-scrolls during streaming responses
|
||||
- 🎨 **Refined UI** - Thinner scrollbar, cleaner styling
|
||||
- 🔧 **Updated Models** - Claude 4.5 (Sonnet, Haiku, Opus)
|
||||
|
||||
### v3.0.0 (Beta)
|
||||
- 🎨 **Complete migration to Textual TUI** - Modern async terminal interface
|
||||
- 🗑️ **Removed CLI interface** - TUI-only for cleaner codebase (11.6% smaller)
|
||||
- 🖱️ **Modal screens** - Help, stats, config, credits, model selector
|
||||
|
||||
Reference in New Issue
Block a user