Initial commit
This commit is contained in:
146
docs/setup/OPENROUTER_SETUP.md
Normal file
146
docs/setup/OPENROUTER_SETUP.md
Normal file
@@ -0,0 +1,146 @@
|
||||
# OpenRouter Integration Guide
|
||||
|
||||
EVE now uses **OpenRouter** as the unified AI provider, giving you access to multiple models through a single API key.
|
||||
|
||||
## Why OpenRouter?
|
||||
|
||||
- **One API Key**: Access GPT-4, Claude, Llama, Gemini, and 100+ other models
|
||||
- **Pay-as-you-go**: Only pay for what you use, no subscriptions
|
||||
- **Model Flexibility**: Switch between models in real-time
|
||||
- **Cost Effective**: Competitive pricing across all providers
|
||||
|
||||
## Getting Your API Key
|
||||
|
||||
1. Visit [OpenRouter](https://openrouter.ai/keys)
|
||||
2. Sign in with Google or GitHub
|
||||
3. Create a new API key
|
||||
4. Copy the key (starts with `sk-or-v1-...`)
|
||||
|
||||
## Setting Up EVE
|
||||
|
||||
### Option 1: Using the UI (Recommended)
|
||||
|
||||
1. Launch EVE: `npm run tauri:dev`
|
||||
2. Click "Configure Settings" on the welcome screen
|
||||
3. Paste your OpenRouter API key
|
||||
4. Click "Save & Close"
|
||||
|
||||
### Option 2: Using .env File
|
||||
|
||||
1. Copy the example file:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
2. Edit `.env` and add your key:
|
||||
```
|
||||
VITE_OPENROUTER_API_KEY=sk-or-v1-your-actual-key-here
|
||||
```
|
||||
|
||||
3. Restart the application
|
||||
|
||||
## Available Models
|
||||
|
||||
EVE provides quick access to these popular models:
|
||||
|
||||
### OpenAI
|
||||
- **GPT-4 Turbo**: Best overall performance
|
||||
- **GPT-4**: High quality, slower
|
||||
- **GPT-3.5 Turbo**: Fast and cost-effective
|
||||
|
||||
### Anthropic (Claude)
|
||||
- **Claude 3 Opus**: Best for complex tasks
|
||||
- **Claude 3 Sonnet**: Balanced performance
|
||||
- **Claude 3 Haiku**: Fast responses
|
||||
|
||||
### Google
|
||||
- **Gemini Pro**: Google's latest model
|
||||
- **Gemini Pro Vision**: Supports images (future feature)
|
||||
|
||||
### Meta (Llama)
|
||||
- **Llama 3 70B**: Powerful open model
|
||||
- **Llama 3 8B**: Very fast responses
|
||||
|
||||
### Other
|
||||
- **Mistral Medium**: European alternative
|
||||
- **Mixtral 8x7B**: Mixture of experts model
|
||||
|
||||
## Usage
|
||||
|
||||
1. **Select a Model**: Click the model selector in the header
|
||||
2. **Start Chatting**: Type your message and press Enter
|
||||
3. **Switch Models**: Change models anytime mid-conversation
|
||||
|
||||
## Pricing
|
||||
|
||||
OpenRouter uses pay-per-token pricing. Approximate costs:
|
||||
|
||||
- **GPT-3.5 Turbo**: ~$0.002 per 1K tokens
|
||||
- **GPT-4 Turbo**: ~$0.01 per 1K tokens
|
||||
- **Claude 3 Haiku**: ~$0.0008 per 1K tokens
|
||||
- **Llama 3**: Often free or very cheap
|
||||
|
||||
Check current pricing: [OpenRouter Pricing](https://openrouter.ai/models)
|
||||
|
||||
## Features Implemented
|
||||
|
||||
✅ **Chat Interface**: Full conversation support with history
|
||||
✅ **Model Selection**: Switch between 10+ popular models
|
||||
✅ **Settings Panel**: Configure API keys and parameters
|
||||
✅ **Temperature Control**: Adjust response creativity
|
||||
✅ **Max Tokens**: Control response length
|
||||
✅ **Persistent Settings**: Settings saved locally
|
||||
|
||||
## API Client Features
|
||||
|
||||
The `OpenRouterClient` in `src/lib/openrouter.ts` provides:
|
||||
|
||||
- **Simple Chat**: One-line method for quick responses
|
||||
- **Streaming**: Real-time token-by-token responses (ready for future use)
|
||||
- **Error Handling**: Graceful error messages
|
||||
- **Model Discovery**: Fetch all available models dynamically
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "OpenRouter API key not found"
|
||||
- Make sure you've set the key in Settings or `.env`
|
||||
- Key should start with `sk-or-v1-`
|
||||
- Restart the app after adding the key
|
||||
|
||||
### "API error: 401"
|
||||
- Your API key is invalid
|
||||
- Get a new key from [OpenRouter](https://openrouter.ai/keys)
|
||||
|
||||
### "API error: 429"
|
||||
- Rate limit exceeded
|
||||
- Wait a moment and try again
|
||||
- Check your OpenRouter account balance
|
||||
|
||||
### Response is cut off
|
||||
- Increase "Max Tokens" in Settings
|
||||
- Some models have lower limits
|
||||
|
||||
## Next Steps
|
||||
|
||||
With OpenRouter integrated, you can now:
|
||||
|
||||
1. ✅ Chat with multiple AI models
|
||||
2. 🚧 Add voice integration (Phase 2)
|
||||
3. 🚧 Add avatar system (Phase 3)
|
||||
4. 🚧 Implement streaming responses for real-time output
|
||||
5. 🚧 Add conversation export/import
|
||||
|
||||
## Development Notes
|
||||
|
||||
The OpenRouter integration includes:
|
||||
|
||||
- **Type-safe API client** (`src/lib/openrouter.ts`)
|
||||
- **Zustand state management** (`src/stores/chatStore.ts`, `src/stores/settingsStore.ts`)
|
||||
- **React components** (`src/components/ChatInterface.tsx`, etc.)
|
||||
- **Persistent storage** (Settings saved to localStorage via Zustand persist)
|
||||
|
||||
All model IDs and parameters are fully typed for autocomplete and safety.
|
||||
|
||||
---
|
||||
|
||||
**Ready to start chatting!** 🚀
|
||||
117
docs/setup/SETUP_COMPLETE.md
Normal file
117
docs/setup/SETUP_COMPLETE.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# ✅ Development Environment Setup Complete
|
||||
|
||||
Your EVE development environment is ready to go!
|
||||
|
||||
## What's Been Set Up
|
||||
|
||||
### ✅ Project Structure
|
||||
|
||||
- Tauri (Rust) backend configured
|
||||
- React + TypeScript frontend
|
||||
- TailwindCSS for styling
|
||||
- Vite build tool
|
||||
- ESLint + Prettier for code quality
|
||||
|
||||
### ✅ Dependencies Installed
|
||||
|
||||
- All Node.js packages installed (282 packages)
|
||||
- Rust toolchain detected (v1.88.0)
|
||||
|
||||
### ✅ Files Created
|
||||
|
||||
- Configuration files (package.json, tsconfig.json, vite.config.ts, etc.)
|
||||
- Tauri backend (`src-tauri/`)
|
||||
- React frontend (`src/`)
|
||||
- README with full documentation
|
||||
- Environment template (`.env.example`)
|
||||
|
||||
## Next Steps
|
||||
|
||||
### 1. Start Development Server
|
||||
|
||||
To see your app in action:
|
||||
|
||||
```bash
|
||||
npm run tauri:dev
|
||||
```
|
||||
|
||||
This will:
|
||||
|
||||
- Build the Rust backend
|
||||
- Start the Vite dev server
|
||||
- Launch the EVE desktop application
|
||||
|
||||
**Note**: First run will take a few minutes as Rust compiles dependencies.
|
||||
|
||||
### 2. Set Up API Keys (Optional)
|
||||
|
||||
If you want to enable AI features:
|
||||
|
||||
```bash
|
||||
# Copy the example env file
|
||||
cp .env.example .env
|
||||
|
||||
# Edit .env and add your API keys
|
||||
# - OpenAI API key for GPT models
|
||||
# - ElevenLabs API key for TTS
|
||||
```
|
||||
|
||||
### 3. Development Workflow
|
||||
|
||||
```bash
|
||||
# Start development
|
||||
npm run tauri:dev
|
||||
|
||||
# In another terminal, run tests (when added)
|
||||
npm run test
|
||||
|
||||
# Format code
|
||||
npm run format
|
||||
|
||||
# Lint code
|
||||
npm run lint
|
||||
```
|
||||
|
||||
## Quick Test
|
||||
|
||||
The starter app includes a simple greeting function to test the Tauri integration:
|
||||
|
||||
1. Run `npm run tauri:dev`
|
||||
2. Enter your name in the input field
|
||||
3. Click "Greet" to test the Rust ↔ React communication
|
||||
|
||||
## Known Issues
|
||||
|
||||
- ⚠️ Icons not yet created (placeholder in `src-tauri/icons/`)
|
||||
- ⚠️ 2 moderate npm vulnerabilities (non-critical for development)
|
||||
|
||||
To address npm vulnerabilities later:
|
||||
|
||||
```bash
|
||||
npm audit fix
|
||||
```
|
||||
|
||||
## What's Next?
|
||||
|
||||
According to the [Project Plan](../planning/PROJECT_PLAN.md), Phase 1 includes:
|
||||
|
||||
### Immediate Priorities
|
||||
|
||||
1. ✅ Basic application structure (DONE)
|
||||
2. ⏳ LLM integration module
|
||||
3. ⏳ Chat interface UI
|
||||
4. ⏳ Settings/configuration system
|
||||
5. ⏳ Message history display
|
||||
|
||||
See the project plan for the full 18-week roadmap!
|
||||
|
||||
## Need Help?
|
||||
|
||||
- Check [Root README](../../README.md) for detailed documentation
|
||||
- Review the [Project Plan](../planning/PROJECT_PLAN.md) for the development roadmap
|
||||
- See Tauri docs: <https://tauri.app/>
|
||||
- React docs: <https://react.dev/>
|
||||
|
||||
---
|
||||
|
||||
**Happy Coding!** 🚀
|
||||
Reference in New Issue
Block a user