OpenGPTs - the Open Source Alternative to Custom GPTs

Introducing OpenGPT, an open-source alternative to OpenAI's Custom GPTs developed by LangChain devs.

1000+ Pre-built AI Apps for Any Use Case

OpenGPTs - the Open Source Alternative to Custom GPTs

Start for free
Contents

In the ever-evolving landscape of artificial intelligence, the emergence of OpenGPTs stand as a significant development, offering an open-source alternative to OpenAI's Custom GPTs. This groundbreaking platform is not just a replication of existing models; it's a comprehensive system that provides users with unprecedented control and customization over their AI applications. In this article, we delve into the intricate features of OpenGPTs, its configuration capabilities, and the advantages it offers in the realm of AI and machine learning.

Want to create Customized, GPT Apps? You can also try using Anakin AI!

Anakin AI is a NO CODE platform to create any AI powered Apps. You can use the latest models such as:

GPT-4, Claude-2.1, Stable Diffusion, DALLE 3....

Introduction to OpenGPTs

OpenGPTs are pioneering initiative in the field of artificial intelligence. Built upon a foundation of LangChain, LangServe, and LangSmith, this platform is designed to create an experience similar to OpenAI's GPTs and Assistants API. However, what sets OpenGPTs apart is its flexibility and the level of control it offers to users. It caters to a wide range of needs, from choosing language models and prompt configurations to selecting tools and vector databases.

Core Features of OpenGPTs

1. Choice of Language Models (LLMs):

OpenGPTs provide the option to select from over 60 language models offered by LangChain. This flexibility allows users to pick a model that best suits their specific requirements, whether it's for natural language processing, data analysis, or any other AI-driven task.

2. Customizable Prompts:

With LangSmith, users can debug and tailor their prompts. This feature is crucial for fine-tuning the AI's responses, ensuring that the output aligns with the user's intentions and the context of the application.

3. Extensive Tool Selection:

OpenGPTs boast an impressive array of over 100 tools from LangChain's library. Users can also create their own tools to integrate with the system, enhancing the platform's functionality and adaptability.

4. Vector Database Integration:

The platform supports integration with over 60 vector databases from LangChain. This feature is instrumental in handling complex data sets and performing sophisticated data analysis tasks.

5. Customizable Retrieval Algorithms:

OpenGPTs allow users to choose and configure their retrieval algorithms, optimizing the process of extracting and processing information.

6. Chat History Database:

The platform provides options for setting up a chat history database, an essential feature for applications that require tracking and analyzing conversational data.

Expanded Installation and Customization of OpenGPTs

The installation and customization of OpenGPTs are integral to its utility and flexibility. This section provides an in-depth look at the process, including detailed steps and sample code snippets.

How to Install OpenGPTs

Setting Up the Backend:

  • Install the necessary requirements:
cd backend
pip install -r requirements.txt
  • Set up the persistence layer using Redis. This requires setting the REDIS_URL environment variable. You can export this variable in your shell:
export REDIS_URL='your_redis_url'

Configuring the Vector Database:

  • If using Redis as a vectorstore, the REDIS_URL set earlier will suffice. However, to integrate other vector databases from LangChain's offerings, follow their specific setup guidelines.

Language Model Configuration:

  • Set environment variables for the desired language model. For example, for using OpenAI:
export OPENAI_API_KEY="your_openai_api_key"
  • If opting for other models like Azure OpenAI or Anthropic, set their respective environment variables. Here are examples for Azure OpenAI and Anthropic:
  • For Azure OpenAI:
export AZURE_OPENAI_API_BASE="your_azure_openai_api_base_url"
export AZURE_OPENAI_API_VERSION="your_azure_openai_api_version"
export AZURE_OPENAI_API_KEY="your_azure_openai_api_key"
export AZURE_OPENAI_DEPLOYMENT_NAME="your_azure_openai_deployment_name"

For Anthropic's Claude 2:

export ANTHROPIC_API_KEY="your_anthropic_api_key"

For Amazon Bedrock, ensure valid AWS credentials:

export AWS_ACCESS_KEY_ID="your_aws_access_key_id"
export AWS_SECRET_ACCESS_KEY="your_aws_secret_access_key"

Setting Up Tools:

  • Many tools available in OpenGPTs require additional environment variables. For instance, to enable DuckDuckGo Search, no extra settings are needed, but for Tavily Search, set:
export TAVILY_API_KEY="your_tavily_api_key"

Monitoring and Debugging:

  • Set up LangSmith for enhanced monitoring and debugging:
export LANGCHAIN_TRACING_V2="true"
export LANGCHAIN_API_KEY="your_langchain_api_key"

Starting the Backend Server:

  • Launch the backend server using LangChain:
langchain serve --port=8100

Setting Up the Frontend:

  • Navigate to the frontend directory and install dependencies:
cd frontend
yarn
  • Start the frontend development server:
yarn dev

Customization Steps

Custom LLMs and Agent Configuration:

  • To add or edit LLMs, navigate to backend/packages/gizmo-agent/gizmo_agent/agent_types.
  • Here, you can modify existing configurations or add new ones, adjusting the parameters to suit your specific requirements.

Defining Custom Tools:

  • OpenGPTs allow the definition of custom tools in Python. Follow the guide provided by LangChain for detailed instructions.
  • Here’s a basic structure for creating a custom tool:
class CustomTool:
    def __init__(self, param1, param2):
        self.param1 = param1
        self.param2 = param2

    def perform_action(self, input):
        # Logic for the tool's action
        return result

Integrating Custom Tools into OpenGPTs:

  • After defining your custom tool, integrate it into OpenGPTs' backend. This can be done by updating the relevant configuration files where tools are defined and imported.

Customizing the Frontend:

  • The frontend can be customized in terms of UI/UX to match the branding or specific user interface requirements.
  • This involves editing the React components in the frontend directory, utilizing standard web development practices.

Deploying Customizations:

  • After making changes to the backend or frontend, ensure to restart the servers to apply the changes.
  • For Docker-based setups, rebuild the Docker images with your changes using:
docker-compose up --build

Through these steps, OpenGPTs can be tailored to fit a wide array of applications, from simple chatbots to complex AI-driven systems. The open-source nature of OpenGPTs not only fosters customization but also encourages community-driven enhancements, ensuring its evolution in line with the latest advancements in AI technology.

GitHub - langchain-ai/opengpts
Contribute to langchain-ai/opengpts development by creating an account on GitHub.

OpenGPTs vs OpenAI's Custom GPTs: Pros and Cons

OpenGPTs' architecture offers several advantages over traditional custom GPT models:

  1. Customization: The ability to choose from a wide array of language models, tools, and vector databases allows for a high level of customization, making OpenGPTs suitable for a diverse range of applications.
  2. Control: Users have more control over the prompts, retrieval algorithms, and the overall configuration, enabling them to tailor the AI system to their specific needs.
  3. Flexibility: The open-source nature of OpenGPT means that it is continuously evolving with contributions from the community, ensuring that it remains at the forefront of AI technology.
  4. Accessibility: Being an open-source platform, OpenGPT is more accessible to a wider audience, including researchers, developers, and small to medium-sized enterprises that might find proprietary models cost-prohibitive.
  5. Community Support: OpenGPT benefits from the support and contributions of a vibrant community, leading to rapid development, bug fixes, and feature enhancements.

Conclusion

In conclusion, OpenGPTs represent significant step forward in the world of artificial intelligence. Its customizable, flexible, and user-centric design makes it a compelling alternative to OpenAI's Custom GPTs, catering to the diverse needs of today's AI-driven world. Whether it's for research, development, or commercial applications, OpenGPTs offer robust and adaptable platform for anyone looking to harness the power of AI.

Want to create Customized, GPT Apps? You can also try using Anakin AI!

Anakin AI is a NO CODE platform to create any AI powered Apps. You can use the latest models such as GPT-4, Claude-2.1, Stable Diffusion, DALLE 3...