A professional, clean web-based chatbot frontend for Ollama endpoints. Developed by 3eekeeper.
CR Chatbot is a simple yet powerful web interface that allows users to interact with Ollama language models through a clean, professional interface. Built with vanilla HTML, CSS, and JavaScript, it requires no external dependencies and provides all essential functionality for a complete chat experience.
- ✅ Professional UI: Clean, modern design with intuitive user experience
- ✅ Ollama Integration: Direct connection to any Ollama endpoint
- ✅ Custom System Prompts: Set personalized system prompts for different use cases
- ✅ Conversation History: Maintains conversation context during sessions
- ✅ Message Formatting: Support for basic markdown formatting (bold, italic, code)
- ✅ Real-time Status: Connection status indicator with visual feedback
- ✅ Responsive Design: Works seamlessly on desktop and mobile devices
- ✅ Save Conversations: Export entire conversations to plain text files
- ✅ Multiple Conversations: Start new conversations while preserving history
- ✅ Configuration Panel: Easy setup and management of settings
- ✅ Error Handling: Comprehensive error handling with user-friendly messages
- ✅ Toast Notifications: Non-intrusive status updates and alerts
- ✅ Thinking Models Support: Collapsible thinking process display for models that show their reasoning (like o1)
- ✅ Keyboard Shortcuts:
Enter: Send messageShift + Enter: New line
- ✅ Auto-scroll: Automatically scrolls to latest messages
- ✅ Character Counter: Input validation with character limit display
- ✅ Connection Testing: Test Ollama connectivity before chatting
- ✅ No Dependencies: Pure vanilla JavaScript implementation
- ✅ Local Storage: Automatic configuration persistence
- ✅ Accessibility: Screen reader friendly with proper ARIA labels
- ✅ Dark/Light Theme: Automatic theme detection based on system preferences
- ✅ Performance Optimized: Efficient DOM manipulation and memory usage
- ✅ Cross-browser Compatible: Works on all modern browsers
- A running Ollama instance (default:
http://localhost:11434) - At least one language model installed in Ollama
- A modern web browser
-
Clone or Download: Get the CR Chatbot files
git clone <repository-url> cd cr-chatbot
-
Serve the Files: Use any local web server
# Option 1: Python (if installed) python -m http.server 8080 # Option 2: Node.js (if installed) npx serve . # Option 3: Use VS Code Live Server extension # Right-click on index.html and select "Open with Live Server"
-
Open in Browser: Navigate to
http://localhost:8080 -
Configure: Click the "Settings" button and configure your Ollama endpoint
- Open Settings: Click the gear icon in the header
- Set Ollama URL: Enter your Ollama endpoint (e.g.,
http://localhost:11434) - Choose Model: Specify the model name (e.g.,
llama3.2,mistral,codellama) - System Prompt: Customize the AI's behavior with a system prompt
- Test Connection: Use the "Test Connection" button to verify setup
- Save: Click "Save Configuration" to persist settings
- Ensure Ollama is running and a model is available
- Configure the endpoint in settings
- Type your message in the input field
- Press
Enteror click the send button
- New Chat: Click "New Chat" to start fresh
- Clear Chat: Remove all messages from current conversation
- Save Conversation: Export chat history to a text file
The chatbot supports basic markdown formatting:
- Bold text:
**bold**→ bold - Italic text:
*italic*→ italic Inline code:`code`→code- Code blocks:
code→ formatted code block
CR Chatbot automatically detects and handles thinking models (like o1) that include reasoning steps:
- Automatic Detection: Messages with
<think>tags are automatically processed - Collapsible Display: Thinking process is hidden by default in a collapsible section
- Toggle Visibility: Click "🤔 Thinking process" to expand and view the AI's reasoning
- Clean Interface: Only the final response is shown prominently, keeping the interface clean
Enter: Send messageShift + Enter: Add new line without sendingCtrl/Cmd + /: Focus message input (when available)
cr-chatbot/
├── index.html # Main HTML file
├── styles.css # Complete styling and theming
├── script.js # Core JavaScript functionality
├── README.md # This documentation
└── chatbot/ # Directory for saved conversations
└── (saved files will appear here)
- Endpoint URL: The base URL of your Ollama instance
- Model Name: The specific model to use for conversations
- System Prompt: Instructions that define the AI's behavior
{
"ollamaUrl": "http://localhost:11434",
"modelName": "llama3.2",
"systemPrompt": "You are a helpful AI assistant. Please provide accurate and concise responses."
}Connection Failed
- Ensure Ollama is running:
ollama serve - Check the endpoint URL in settings
- Verify firewall settings allow connections
- Try the connection test in settings
Model Not Found
- List available models:
ollama list - Pull a model if needed:
ollama pull llama3.2 - Check model name spelling in settings
Interface Not Loading
- Ensure you're serving files over HTTP (not file://)
- Check browser console for JavaScript errors
- Try a different browser or incognito mode
Conversations Not Saving
- Check browser permissions for downloads
- Ensure sufficient disk space
- Try a different browser if issues persist
If you don't have Ollama installed:
- Install Ollama: Visit ollama.ai for installation instructions
- Start Ollama: Run
ollama servein your terminal - Pull a Model: Download a model with
ollama pull llama3.2 - Verify: Test with
ollama run llama3.2 "Hello"
CR Chatbot works on all modern browsers:
- ✅ Chrome 80+
- ✅ Firefox 75+
- ✅ Safari 13+
- ✅ Edge 80+
- ES6+ JavaScript support
- CSS Grid and Flexbox
- Fetch API
- Local Storage
- File Download API
- Local Communication: All data stays between your browser and Ollama
- No External Services: No data sent to third-party servers
- Local Storage: Configuration stored locally in your browser
- HTTPS Recommended: Use HTTPS in production environments
- Efficient Rendering: Only renders new messages, not entire conversation
- Memory Management: Proper cleanup of event listeners and references
- Responsive Images: SVG icons for crisp display at any size
- Minimal Dependencies: No external libraries to load
- Memory: ~2-5MB typical usage
- Storage: Configuration < 1KB, conversations vary by length
- Network: Only API calls to Ollama, no other external requests
The interface automatically adapts to your system's dark/light theme preference. Colors and spacing are defined using CSS custom properties for easy customization.
The codebase is well-structured for adding new features:
- Event handling in
bindEvents() - UI updates in
updateUI() - API communication in
sendToOllama() - Message rendering in
renderMessage()
- Class-based Architecture:
CRChatbotclass encapsulates all functionality - Event-driven Design: Clean separation of concerns
- Modular Functions: Each function has a single responsibility
- Error Handling: Comprehensive try-catch blocks with user feedback
- Install VS Code with Live Server extension
- Open the project folder in VS Code
- Right-click
index.htmland select "Open with Live Server" - Test all functionality with a local Ollama instance
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Use ES6+ features where appropriate
- Follow consistent naming conventions
- Add comments for complex logic
- Maintain responsive design principles
- Test on multiple browsers
MIT License - feel free to use and modify for your projects.
For issues, questions, or contributions:
- Check the troubleshooting section
- Review the Ollama documentation
- Open an issue with detailed information
- ✅ Initial release
- ✅ Complete Ollama integration
- ✅ Professional UI design
- ✅ Conversation management
- ✅ Configuration system
- ✅ File export functionality
- ✅ Responsive design
- ✅ Error handling
- ✅ Toast notifications
- 🔄 Conversation history persistence
- 🔄 Multiple model support in single interface
- 🔄 Message export to different formats
- 🔄 Keyboard shortcut customization
- 🔄 Plugin system for extensions
Developed by 3eekeeper | CR Chatbot v1.0
A simple, professional chatbot interface for Ollama that just works.