Skip to main content

OpenCopilot Backend

Project description

OpenCopilot

🕊️ OpenCopilot: Build and embed open-source AI Copilots into your product with ease

Unit tests E2E tests Package version Package version Package version

Documentation: docs.opencopilot.dev

🕊️ OpenCopilot Overview

Copilots are becoming the new paradigm how to build successful LLM-based applications, as seen by Github, Shopify, Brex, Hubspot, etc Copilots. Yet, building a Copilot that goes beyond a Twitter demo is time-consuming, unreliable and overly complex. Moreover, existing solutions such as Microsoft Copilot Stack are closed-source. Today, building an LLM-app feels like:

Author: Soham Chatterjee

OpenCopilot solves this problem so building your own Copilot becomes intuitive, fast and reliable - all so you can build your copilot in a single day. For example, you can build Copilots such as:

🛠️ Developer tooling Copilot

💾 SaaS Copilot

💳 E-commerce Copilot

See more use cases in docs.

⚡ Quickstart

As prerequisites, you need to have Python 3.8+ and pip installed.

1. Install the OpenCopilot Python package

pip install opencopilot-ai

2. Create a new python file to set up a minimal Copilot

For example, you can create an AWS CLI Copilot using the following code by adding it to a copilot.py file. Make sure to replace openai_api_key with your 🔑 own OpenAI API key.

from opencopilot import OpenCopilot

PROMPT = """
You are an Amazon Web Services (AWS) CLI copilot. You are an interactive version of AWS CLI documentation and chat with developers who need help using it.
Your mission is to be a reliable companion throughout the developer journey - always ready to answer questions and share insights.

=========
{context}
=========

{history}
User: {question}
AWS CLI Copilot answer in Markdown:
"""

copilot = OpenCopilot(
    copilot_name="AWS CLI Copilot",
    openai_api_key="your-openai-api-key",
    # You can also use gpt-4 for improved accuracy
    # or Llama 2 locally (https://docs.opencopilot.dev/create/opensource-llms#running-an-llm)
    llm="gpt-3.5-turbo-16k",
    prompt=PROMPT,
)

# Download and embed the knowledge base from given URL
copilot.add_data_urls(
    [
        "https://awsdocs.s3.amazonaws.com/cli/latest/aws-cli.pdf",
    ]
)

# Run the copilot
copilot()

3. Run the Copilot

python copilot.py

4. Chat with the Copilot

You can chat with your copilot in the UI at localhost:3000/ui or using the CLI:

opencopilot chat "Hello, who are you?"

5. Create your own copilot

After seeing how easy it is to set up a copilot, you can now create your own and level it up step by step. For this, see docs.opencopilot.dev, or check a more detailed example of the AWS copilot in the examples directory.

🔍 Stack Overview

OpenCopilot provides one coherent end-to-end stack which is purposely designed for building a variety of copilots. From LLM selection (OSS LLMs upcoming), knowledge base, monitoring, evaluation, etc - it covers all the needs to build a useful copilot.

opencopilot_stack

See our docs on Stack Overview to learn more about each part of the OpenCopilot stack.

Analytics

OpenCopilot collects library usage data to improve the product and your experience. We collect events regarding errors and your usage of copilot features, and never collect your code, prompts, knowledge base documents, or LLM outputs. To understand what is tracked, check out the tracking code.

You can opt out of tracking by setting the environment variable OPENCOPILOT_DO_NOT_TRACK=True:

export OPENCOPILOT_DO_NOT_TRACK=True

Getting help

If you have any questions about OpenCopilot, feel free to do any of the following:

  • Join our Discord and ask.
  • Report bugs or feature requests in GitHub issues.
  • Directly email Taivo, Co-founder & CTO of OpenCopilot: taivo@opencopilot.dev.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencopilot-ai-0.3.8.tar.gz (163.5 kB view details)

Uploaded Source

Built Distribution

opencopilot_ai-0.3.8-py3-none-any.whl (243.2 kB view details)

Uploaded Python 3

File details

Details for the file opencopilot-ai-0.3.8.tar.gz.

File metadata

  • Download URL: opencopilot-ai-0.3.8.tar.gz
  • Upload date:
  • Size: 163.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for opencopilot-ai-0.3.8.tar.gz
Algorithm Hash digest
SHA256 b83b7050b808821df63f1918ab7abdffceab839749a15313b62a38ab328836f7
MD5 89169daa026a468c33dd9b99ff2b95c1
BLAKE2b-256 3cb538ef0c670c6b6ec94d3d523f109f4cb056bcac5e9bcaac83ab92bfc946ae

See more details on using hashes here.

File details

Details for the file opencopilot_ai-0.3.8-py3-none-any.whl.

File metadata

File hashes

Hashes for opencopilot_ai-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5c40bd69db9264140fa3ff59076af5b0c790bb364b81eabb583d40a26519881d
MD5 eade9342cf7dbad7f95942f69e1b7963
BLAKE2b-256 c180989b3bf53a72651bf2c88839183276773671d29058272a02fa32180e8c55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page