A minimalist chat interface built with React and TypeScript, supporting multiple AI providers including Cerebras, OpenAI, and Anthropic. This application provides a clean and intuitive chat experience with AI, featuring markdown support and real-time streaming responses.
- Clean and intuitive chat interface
- Dynamic model switching with a floating stone-like UI
- Real-time streaming responses with typing effect
- Markdown message formatting support
- Code block syntax highlighting with copy functionality
- Responsive design with a modern neumorphic style
- Keyboard shortcuts for efficient interaction
- React 19
- TypeScript
- Vite
- Tailwind CSS
- Axios
- React Markdown
Before you begin, ensure you have:
- Node.js (latest LTS version recommended)
- npm (comes with Node.js)
- API keys for the services you want to use (Cerebras, OpenAI, or Anthropic)
- Clone the repository:
git clone https://github.com/foxn2000/Mono-Chat.git
cd mono-chat- Install dependencies:
npm install- Create a
.envfile in the root directory:
cp .env.example .env- Add your API keys to the
.envfile:
# Cerebras API settings
VITE_CEREBRAS_BASE_URL=https://api.cerebras.ai/v1
# OpenAI API settings
VITE_OPENAI_API_KEY=your_openai_api_key_here
# Anthropic API settings
VITE_ANTHROPIC_API_KEY=your_anthropic_api_key_here
- Configure your models in
models.yaml:
models:
# Default model to use
default: cerebras-llama4
# Available models
available:
cerebras-llama4:
name: llama-4-scout-17b-16e-instruct
baseUrl: https://api.cerebras.ai/v1/chat/completions
apiKeyEnvName: VITE_CEREBRAS_API_KEY
defaultParams:
temperature: 0.7
max_tokens: 1000
# Add more models as needed- Start the development server:
npm run dev-
Open your browser and navigate to
http://localhost:5173 -
Start chatting with the AI by typing your message and pressing:
- Ctrl+Enter (Windows/Linux) or
- Cmd+Enter (macOS) to send your message
- Message Input: Type your message in the input field at the bottom
- Send Message: Use Ctrl+Enter (or Cmd+Enter on macOS) to send
- Copy Text: Click on any message to copy its content
- Code Blocks: Code snippets are automatically formatted and can be copied with a click
- Model Selection: Hover over the top-left corner to reveal the model selector, which appears like a floating stone. Click to view and select from available models
mono-chat/
├── src/
│ ├── api/ # API integration and factory
│ ├── components/ # React components
│ ├── config/ # Configuration management
│ ├── hooks/ # Custom React hooks
│ ├── styles/ # CSS styles
│ ├── types/ # TypeScript type definitions
│ └── assets/ # Static assets
├── public/ # Public assets
├── models.yaml # Model configurations
└── ...config files # Various configuration files
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
The following environment variables are supported:
VITE_CEREBRAS_API_KEY: Your Cerebras API keyVITE_CEREBRAS_BASE_URL: Cerebras API base URL (defaults to https://api.cerebras.ai/v1)VITE_OPENAI_API_KEY: Your OpenAI API keyVITE_ANTHROPIC_API_KEY: Your Anthropic API key
Models are configured in the models.yaml file. You can:
- Set a default model
- Configure multiple models from different providers
- Customize model parameters (temperature, max tokens, etc.)
- Add new models easily
The application supports any OpenAI API-compatible service, including:
- Cerebras AI
- OpenAI
- Anthropic
- Other OpenAI API-compatible services
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
