Synapse is an AI-powered chat application built with Vite and React. It provides a modern, user-friendly interface for interacting with multiple AI models through the Pollinations API. With support for real-time streaming responses, image attachments, and customizable system instructions, Synapse offers a flexible platform for AI-assisted conversations.
- Multi-Model Support: Switch between different AI models (OpenAI, Mistral, Llama, and more) from the settings panel.
- Real-time Streaming: Get instant, streamed responses from AI models as they're generated.
- Image Support: Attach and send images with your messages for multimodal AI interactions.
- Chat Sessions: Create and manage multiple independent chat sessions with persistent storage.
- System Instructions: Define custom system prompts to guide AI behavior for each session.
- Theme Support: Toggle between light and dark themes for comfortable viewing.
- Responsive Design: Fully responsive interface that works seamlessly on desktop and mobile devices.
- Markdown Rendering: Display formatted responses with markdown support and syntax highlighting for code blocks.
To get started with Synapse locally, follow these steps:
-
Clone the repository:
git clone https://github.com/Aegis-plus/Synapse.git cd synapse -
Install Dependencies:
npm install # or yarn install -
Set Up Environment Variables: Create a
.envfile in the root directory and add your Pollinations API key:API_KEY=your_pollinations_api_key_here(Note: You can obtain an API key from Pollinations)
-
Run the Development Server:
npm run dev # or yarn devThis will start the development server, typically on
http://localhost:3000.
Once the development server is running, you can access the application in your browser:
- Select a Model: Use the settings panel on the right to choose your preferred AI model.
- Start Chatting: Type your message in the input field and press Enter or click the send button.
- Add Images: Click the attachment button to add images to your messages for multimodal conversations.
- Manage Sessions: Create new chat sessions from the sidebar, or click on existing sessions to switch between them.
- Customize Behavior: Set system instructions in the settings panel to guide how the AI responds.
- Switch Themes: Use the theme toggle in the sidebar to switch between light and dark modes.
This project requires the following environment variable to be set:
API_KEY: Your Pollinations API key for authenticating requests to the Pollinations API.
Note: If no API key is provided, the application will still function but may have limited capabilities or rate limiting.
To create an optimized production build:
npm run build
# or
yarn buildThe build output will be in the dist directory, ready for deployment.
To preview the production build locally:
npm run preview
# or
yarn previewDeploying Synapse to Vercel is straightforward:
-
Connect to Vercel:
- Sign up or log in to your Vercel account.
- Create a new project by importing your Git repository. Vercel will automatically detect the Vite framework.
-
Configure Environment Variables:
- In your Vercel project settings, navigate to "Environment Variables".
- Add a new environment variable named
API_KEYand paste your valid Pollinations API key.
-
Build and Deploy:
- Vercel will automatically build and deploy your project using the
npm run buildcommand.
- Vercel will automatically build and deploy your project using the
Your project should now be deployed and accessible via a Vercel URL.
- React 19: Modern React with hooks and functional components.
- TypeScript: Type-safe development with full type support.
- Vite: Lightning-fast build tool and development server.
- Tailwind CSS: Utility-first CSS framework for styling (via Catppuccin theme).
- Lucide React: Beautiful, consistent icon library.
- React Markdown: Markdown rendering in React components.
- React Syntax Highlighter: Syntax highlighting for code blocks.
- Pollinations API: AI model access and chat completion streaming.
synapse/
├── components/ # React components
│ ├── MessageBubble.tsx # Message display component
│ ├── Sidebar.tsx # Chat sessions sidebar
│ └── RightPanel.tsx # Settings and model selection panel
├── services/ # API services
│ └── api.ts # Pollinations API integration
├── App.tsx # Main application component
├── types.ts # TypeScript type definitions
├── index.tsx # Application entry point
├── vite.config.ts # Vite configuration
└── README.md # This file
This project is open source and available under the MIT License.
For issues, questions, or suggestions, please visit the GitHub repository.