NextChat Integration
This guide covers how to integrate EMD-deployed models with NextChat, an open-source cross-platform ChatGPT web UI.
Overview
NextChat (ChatGPT-Next-Web) is a popular open-source project that provides a clean, intuitive web interface for interacting with various large language models. It supports multiple models including OpenAI's GPT models, and importantly, any OpenAI API-compatible endpoints. By integrating EMD-deployed models with NextChat, you can create a user-friendly interface for interacting with your custom models.
With NextChat, you can: - Access your EMD-deployed models through a polished web interface - Create and manage multiple conversations - Save and share conversation history - Customize the UI to match your preferences - Deploy the interface on various platforms
Key Features of NextChat
- Clean User Interface: Modern, responsive design for desktop and mobile
- Multi-model Support: Switch between different models easily
- Conversation Management: Create, save, and organize conversations
- Prompt Templates: Create and use templates for common prompts
- Markdown Support: Rich text formatting with Markdown
- Self-hosting: Deploy on your own infrastructure
- Cross-platform: Available as a web app, PWA, or desktop application
Integrating EMD Models with NextChat
EMD-deployed models can be easily integrated with NextChat through its OpenAI API compatibility. This allows you to use your custom models with all the features and convenience of the NextChat interface.
Prerequisites
- You have successfully deployed a model using EMD with the OpenAI Compatible API enabled
- You have access to NextChat (either through the hosted version or by self-hosting)
- You have the base URL and API key for your deployed model
Configuration Steps
- Access NextChat through your browser
- Click on the settings icon in the sidebar
- Navigate to the "Models" section
- Click "Add Custom Model"
- Configure your EMD-deployed model with the following settings:
- Name: A name for your model (e.g., "My EMD Model")
- Base URL: The endpoint URL of your EMD-deployed model (e.g.,
https://your-endpoint.execute-api.region.amazonaws.com
) - API Key: Your API key for accessing the model
- Model Name: The ID of your deployed model
- Save the configuration
- Select your custom model from the model dropdown in the chat interface
Self-hosting NextChat with EMD Integration
If you prefer to self-host NextChat, you can configure it to use your EMD-deployed model by default:
-
Clone the NextChat repository:
git clone https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git cd ChatGPT-Next-Web
-
Create a
.env.local
file with the following environment variables:OPENAI_API_KEY=your-api-key BASE_URL=https://your-endpoint.execute-api.region.amazonaws.com NEXT_PUBLIC_DEFAULT_MODEL=your-deployed-model-id
-
Build and run the application:
npm install npm run build npm run start
Example Use Cases
With your EMD models integrated into NextChat, you can:
- Personal Assistant: Create a personalized AI assistant using your custom-trained model
- Customer Support: Deploy a customer support interface with domain-specific knowledge
- Content Creation: Use the interface for brainstorming and content generation
- Educational Tool: Create an educational interface with specialized knowledge
- Research Assistant: Build a research assistant with access to specific research domains
Troubleshooting
If you encounter issues connecting to your EMD-deployed model:
- Verify that your model is properly deployed and running
- Check that the Base URL is correct and includes the full endpoint path
- Ensure your API key has the necessary permissions
- Confirm that your model ID exactly matches the deployed model's identifier
- Check browser console logs for any error messages