An experimental AI-powered desktop web browser that generates website content using Large Language Models. Instead of fetching websites from the internet, this application creates simulated website content using AI when you enter a URL.
- AI Content Generation: Generate simulated website content for any domain using LLMs
- Multiple AI Providers: Support for OpenAI GPT-4, Anthropic Claude, and Google Gemini
- Streaming Responses: Real-time content generation with progress indicators
- Modern UI: Clean interface with dark mode support
- Navigation Controls: Back, forward, refresh, and home buttons
- History Management: Track your browsing history
- Security: Content sanitization and sandboxed rendering
- Cross-Platform: Works on Windows, macOS, and Linux
- Node.js 18+ and npm 8+
- API keys for at least one AI provider:
- OpenAI API key
- Anthropic API key
- Google AI API key
-
Clone the repository
git clone https://github.com/chcardoz/llm-browser.git cd llm-browser -
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:OPENAI_API_KEY=your_openai_api_key_here ANTHROPIC_API_KEY=your_anthropic_api_key_here GOOGLE_API_KEY=your_google_api_key_here NODE_ENV=development
-
Start the development server
npm run dev
npm run dev- Start development server with hot reloadnpm run build- Build the application for productionnpm run test- Run testsnpm run test:ui- Run tests with UInpm run test:coverage- Run tests with coverage reportnpm run lint- Check code with Biomenpm run lint:fix- Fix linting issuesnpm run format- Format code with Biomenpm run type-check- Run TypeScript type checking
This project uses automated code quality checks:
- Linting: Automatically runs Biome on staged files
- Formatting: Ensures consistent code formatting
- Type Checking: Validates TypeScript types
- Type Checking: Ensures all TypeScript types are valid
- Tests: Runs the full test suite before pushing
- Conventional Commits: Enforces conventional commit message format
- Examples:
feat: add new feature,fix: resolve bug,docs: update readme
The hooks are automatically installed when you run npm install.
llm-browser/
βββ src/
β βββ main/ # Main process (Electron backend)
β β βββ main.ts # Main process entry point
β β βββ preload.ts # Preload script for IPC
β βββ renderer/ # Renderer process (Frontend)
β β βββ renderer.ts # Renderer entry point
β β βββ browser-ui.ts # Browser UI component
β β βββ styles/
β β βββ main.css # Main styles
β βββ services/ # AI and utility services
β β βββ llm.ts # LLM service implementation
β β βββ provider.ts # AI provider management
β β βββ streaming.ts # Streaming response handling
β β βββ cache.ts # Response caching
β β βββ prompt.ts # Prompt templates
β βββ shared/ # Shared types and utilities
β β βββ types.ts # TypeScript type definitions
β β βββ constants.ts # Application constants
β β βββ logger.ts # Logging utilities
β βββ __tests__/ # Test files
βββ assets/ # Icons and images
βββ docs/ # Documentation
βββ config files
-
Launch the application
- The app opens with a welcome screen showing example URLs
-
Enter a URL
- Type any domain in the address bar (e.g.,
google.com,facebook.com) - Press Enter or click the navigation button
- Type any domain in the address bar (e.g.,
-
Watch AI generate content
- The app uses AI to generate simulated website content
- You'll see a progress indicator during generation
- Content appears in real-time as it's generated
-
Navigate and explore
- Use the back/forward buttons to navigate history
- Switch between AI providers using the dropdown
- Refresh to regenerate content
The application supports multiple AI providers:
- Models: GPT-4, GPT-4 Turbo, GPT-3.5 Turbo
- Best for: General website generation, creative content
- Setup: Add
OPENAI_API_KEYto your.envfile
- Models: Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku
- Best for: Detailed, well-structured content
- Setup: Add
ANTHROPIC_API_KEYto your.envfile
- Models: Gemini Pro, Gemini Pro Vision
- Best for: Fast generation, Google ecosystem integration
- Setup: Add
GOOGLE_API_KEYto your.envfile
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key | No (if using other providers) |
ANTHROPIC_API_KEY |
Anthropic API key | No (if using other providers) |
GOOGLE_API_KEY |
Google AI API key | No (if using other providers) |
NODE_ENV |
Environment (development/production) | Yes |
The application can be configured through the constants file (src/shared/constants.ts):
- Max History Entries: Limit browsing history (default: 100)
- Enable Streaming: Real-time content generation (default: true)
- Default Provider: Auto-select AI provider (default: OpenAI)
- Security Settings: CSP policies and sandboxing
The application includes tests for core functionality:
# Run all tests
npm test
# Run tests with UI
npm run test:ui
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch- Unit Tests: Core functionality and utilities
- Integration Tests: IPC communication and AI service
- Component Tests: Browser UI functionality
The application implements several security measures:
- Content Security Policy: Restricts script execution
- Sandboxed Rendering: Isolates generated content
- Input Sanitization: Cleans user input and AI-generated content
- Secure IPC: Type-safe communication between processes
- Environment Isolation: No direct Node.js access in renderer
# Build for current platform
npm run build
# Build for all platforms
npm run make- Windows:
.exeinstaller and portable - macOS:
.dmgand.app - Linux:
.deb,.rpm, and.AppImage
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Write tests for new features
- Use Biome for linting and formatting
- Update documentation as needed
- Follow conventional commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Electron - Cross-platform desktop app framework
- Vercel AI SDK - AI integration toolkit
- Vite - Fast build tool
- Biome - Fast linter and formatter
- Vitest - Fast unit testing framework
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Initial development version
- AI-powered website generation
- Multiple provider support
- Modern UI with dark mode
- Basic testing suite
Note: This application is for experimental purposes. Generated content is simulated and may not always be accurate or appropriate. Use responsibly and in accordance with AI provider terms of service.