Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codefuse-ChatBot: Development by Private Knowledge Augmentation #682

Open
1 task
irthomasthomas opened this issue Mar 4, 2024 · 2 comments
Open
1 task
Labels
AI-Chatbots Topics related to advanced chatbot platforms integrating multiple AI models Algorithms Sorting, Learning or Classifying. All algorithms go here. code-generation code generation models and tools like copilot and aider New-Label Choose this option if the existing labels are insufficient to describe the content accurately openai OpenAI APIs, LLMs, Recipes and Evals RAG Retrieval Augmented Generation for LLMs technical-writing Links to deep technical writing and books

Comments

@irthomasthomas
Copy link
Owner

codefuse-chatbot/README_en.md at main · codefuse-ai/codefuse-chatbot

DESCRIPTION:

中文  |  English 

Codefuse-ChatBot: Development by Private Knowledge Augmentation

ZH doc EN doc License Open Issues

This project is an open-source AI intelligent assistant, specifically designed for the entire lifecycle of software development, covering design, coding, testing, deployment, and operations. Through knowledge retrieval, tool utilization, and sandbox execution, Codefuse-ChatBot can not only answer professional questions you encounter during the development process but also coordinate multiple independent, dispersed platforms through a conversational interface.

🔔 Updates

  • [2024.01.29] A configurational multi-agent framework, CoAgent, has been open-sourced. For more details, please refer to coagent
  • [2023.12.26] Opening the capability to integrate with open-source private large models and large model interfaces based on FastChat
  • [2023.12.01] Release of Multi-Agent and codebase retrieval functionalities.
  • [2023.11.15] Addition of Q&A enhancement mode based on the local codebase.
  • [2023.09.15] Launch of sandbox functionality for local/isolated environments, enabling knowledge retrieval from specified URLs using web crawlers.

📜 Contents

🤝 Introduction

💡 The aim of this project is to construct an AI intelligent assistant for the entire lifecycle of software development, covering design, coding, testing, deployment, and operations, through Retrieval Augmented Generation (RAG), Tool Learning, and sandbox environments. It transitions gradually from the traditional development and operations mode of querying information from various sources and operating on standalone, disparate platforms to an intelligent development and operations mode based on large-model Q&A, changing people's development and operations habits.

  • 🧠 Intelligent Scheduling Core: Constructed a well-integrated scheduling core system that supports multi-mode one-click configuration, simplifying the operational process. coagent
  • 💻 Comprehensive Code Repository Analysis: Achieved in-depth understanding at the repository level and coding and generation at the project file level, enhancing development efficiency.
  • 📄 Enhanced Document Analysis: Integrated document knowledge bases with knowledge graphs, providing deeper support for document analysis through enhanced retrieval and reasoning.
  • 🔧 Industry-Specific Knowledge: Tailored a specialized knowledge base for the DevOps domain, supporting the self-service one-click construction of industry-specific knowledge bases for convenience and practicality.
  • 🤖 Compatible Models for Specific Verticals: Designed small models specifically for the DevOps field, ensuring compatibility with related DevOps platforms and promoting the integration of the technological ecosystem.

🌍 Relying on open-source LLM and Embedding models, this project can achieve offline private deployments based on open-source models. Additionally, this project also supports the use of the OpenAI API. Access Demo

👥 The core development team has been long-term focused on research in the AIOps + NLP domain. We initiated the CodefuseGPT project, hoping that everyone could contribute high-quality development and operations documents widely, jointly perfecting this solution to achieve the goal of "Making Development Seamless for Everyone."

URL: codefuse-chatbot

Suggested labels

{'label-name': 'intelligent-assistants', 'label-description': 'Technology that assists users in various tasks using artificial intelligence.', 'gh-repo': 'codefuse-ai/codefuse-chatbot', 'confidence': 50.58}

@irthomasthomas irthomasthomas added AI-Chatbots Topics related to advanced chatbot platforms integrating multiple AI models Algorithms Sorting, Learning or Classifying. All algorithms go here. code-generation code generation models and tools like copilot and aider New-Label Choose this option if the existing labels are insufficient to describe the content accurately openai OpenAI APIs, LLMs, Recipes and Evals RAG Retrieval Augmented Generation for LLMs technical-writing Links to deep technical writing and books labels Mar 4, 2024
@irthomasthomas
Copy link
Owner Author

Related issues

#305: Home - LibreChat

### DetailsSimilarity score: 0.89 - [ ] [Home - LibreChat](https://docs.librechat.ai/index.html)

Table of contents
🪶 Features
📃 All-In-One AI Conversations with LibreChat
⭐ Star History
✨ Contributors
💖 This project exists in its current state thanks to all the people who contribute

LibreChat

🪶 Features

🖥️ UI matching ChatGPT, including Dark mode, Streaming, and 11-2023 updates
💬 Multimodal Chat:
Upload and analyze images with GPT-4 and Gemini Vision 📸
More filetypes and Assistants API integration in Active Development 🚧
🌎 Multilingual UI:
English, 中文, Deutsch, Español, Français, Italiano, Polski, Português Brasileiro, Русский
日本語, Svenska, 한국어, Tiếng Việt, 繁體中文, العربية, Türkçe, Nederlands
🤖 AI model selection: OpenAI API, Azure, BingAI, ChatGPT, Google Vertex AI, Anthropic (Claude), Plugins
💾 Create, Save, & Share Custom Presets
🔄 Edit, Resubmit, and Continue messages with conversation branching
📤 Export conversations as screenshots, markdown, text, json.
🔍 Search all messages/conversations
🔌 Plugins, including web access, image generation with DALL-E-3 and more
👥 Multi-User, Secure Authentication with Moderation and Token spend tools
⚙️ Configure Proxy, Reverse Proxy, Docker, many Deployment options, and completely Open-Source
📃 All-In-One AI Conversations with LibreChat

LibreChat brings together the future of assistant AIs with the revolutionary technology of OpenAI's ChatGPT. Celebrating the original styling, LibreChat gives you the ability to integrate multiple AI models. It also integrates and enhances original client features such as conversation and message search, prompt templates and plugins.

With LibreChat, you no longer need to opt for ChatGPT Plus and can instead use free or pay-per-call APIs. We welcome contributions, cloning, and forking to enhance the capabilities of this advanced chatbot platform.

Suggested labels

"ai-platform"

#656: ChatCraft - open-source web companion for coding with LLMs.

### DetailsSimilarity score: 0.88 - [ ] [New Chat - ChatCraft](https://chatcraft.org/c/zIpIpIKuJ8E3S8jlMsJTO)

New Chat - ChatCraft

DESCRIPTION:
Welcome to ChatCraft, your open-source web companion for coding with Large Language Models (LLMs). Designed with developers in mind, ChatCraft transforms the way you interact with GPT models, making it effortless to read, write, debug, and enhance your code.

We think ChatCraft is the best platform for learning, experimenting, and getting creative with code. Here's a few of the reasons why we think you'll agree:

Feature ChatCraft ChatGPT Copilot
Optimized for conversations about code
Work with models from multiple AI vendors
Previews for Mermaid Diagrams, HTML
Edit Generated AI Replies
Use Custom System Prompts
Easy to retry with different AI models
Edit/Run Generated Code and Custom Functions
Open Source

Learn more about ChatCraft on GitHub

Quick Start Instructions
You can begin using ChatCraft today by following these steps:

  1. Choose an AI provider below: we support both OpenAI and OpenRouter. OpenAI supports various versions of ChatGPT (gpt-3.5-turbo) and GPT-4 models, while OpenRouter adds support for even more models from vendors like Anthropic, Google, and Meta. It's easy to switch providers later, or go back-and-forth.
  2. Enter an API Key. ChatCraft is a "bring your own API Key" web app. No matter which provider you choose, ChatCraft needs an API Key to start making API calls on your behalf. API Keys are never shared, and get stored in your browser's local storage.
  3. Start chatting with AI! Type your question in the textbox at the bottom of the screen and click the Ask button to prompt a particular model (switch to a different model whenever you like).
  4. Copy, edit, delete, or retry any AI response with a different model until you get the results you need.
  5. Every chat is saved to a local, offline database in your browser, which you can search (top of UI) or navigate by opening the sidebar with the hamburger menu in the top-left.

Suggested labels

#96: ChatDev: Create Customized Software using Natural Language through LLM-powered Multi-Agent Collaboration

### DetailsSimilarity score: 0.88 - [ ] https://arxiv.org/pdf/2307.07924.pdf

#418: openchat/openchat-3.5-1210 · Hugging Face

### DetailsSimilarity score: 0.88 - [ ] [openchat/openchat-3.5-1210 · Hugging Face](https://huggingface.co/openchat/openchat-3.5-1210#conversation-templates)

Using the OpenChat Model

We highly recommend installing the OpenChat package and using the OpenChat OpenAI-compatible API server for an optimal experience. The server is optimized for high-throughput deployment using vLLM and can run on a consumer GPU with 24GB RAM.

  • Installation Guide: Follow the installation guide in our repository.

  • Serving: Use the OpenChat OpenAI-compatible API server by running the serving command from the table below. To enable tensor parallelism, append --tensor-parallel-size N to the serving command.

    Model Size Context Weights Serving
    OpenChat 3.5 1210 7B 8192 python -m ochat.serving.openai_api_server --model openchat/openchat-3.5-1210 --engine-use-ray --worker-use-ray
  • API Usage: Once started, the server listens at localhost:18888 for requests and is compatible with the OpenAI ChatCompletion API specifications. Here's an example request:

    curl http://localhost:18888/v1/chat/completions \
      -H "Content-Type: application/json" \
      -d '{
            "model": "openchat_3.5",
            "messages": [{"role": "user", "content": "You are a large language model named OpenChat. Write a poem to describe yourself"}]
          }'
  • Web UI: Use the OpenChat Web UI for a user-friendly experience.

Online Deployment

If you want to deploy the server as an online service, use the following options:

  • --api-keys sk-KEY1 sk-KEY2 ... to specify allowed API keys
  • --disable-log-requests --disable-log-stats --log-file openchat.log for logging only to a file.

For security purposes, we recommend using an HTTPS gateway in front of the server.

Mathematical Reasoning Mode

The OpenChat model also supports mathematical reasoning mode. To use this mode, include condition: "Math Correct" in your request.

```bash
curl http://localhost:18888/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
        "model": "openchat_3.5",
        "condition": "Math Correct",
        "messages": [{"role": "user", "content": "10.3 − 7988.8133 = "}]
      }'
```
Conversation Templates

We provide several pre-built conversation templates to help you get started.

  • Default Mode (GPT4 Correct):

    GPT4 Correct User: Hello<|end_of_turn|>
    GPT4 Correct Assistant: Hi<|end_of_turn|>
    GPT4 Correct User: How are you today?<|end_of_turn|>
    GPT4 Correct Assistant:
  • Mathematical Reasoning Mode:

    Math Correct User: 10.3 − 7988.8133=<|end_of_turn|>
    Math Correct Assistant:

    NOTE: Remember to set <|end_of_turn|> as end of generation token.

  • Integrated Tokenizer: The default (GPT4 Correct) template is also available as the integrated tokenizer.chat_template, which can be used instead of manually specifying the template.

Suggested labels

{ "label": "chat-templates", "description": "Pre-defined conversation structures for specific modes of interaction." }

#383: deepseek-ai/deepseek-coder-5.7bmqa-base · Hugging Face

### DetailsSimilarity score: 0.87 - [ ] [deepseek-ai/deepseek-coder-5.7bmqa-base · Hugging Face](https://huggingface.co/deepseek-ai/deepseek-coder-5.7bmqa-base)

Deepseek Coder Introduction

Deepseek Coder is a series of code language models, each trained from scratch on 2T tokens with a composition of 87% code and 13% natural language in both English and Chinese. We provide various sizes of the code model, ranging from 1B to 33B versions. Each model is pre-trained on a project-level code corpus with a window size of 16K and an extra fill-in-the-blank task, supporting project-level code completion and infilling. Deepseek Coder achieves state-of-the-art performance among open-source code models on multiple programming languages and various benchmarks.

Key Features

  • Massive Training Data: Trained from scratch on 2T tokens, including 87% code and 13% linguistic data in both English and Chinese languages.
  • Highly Flexible & Scalable: Offered in model sizes of 1.3B, 5.7B, 6.7B, and 33B, enabling users to choose the setup most suitable for their requirements.
  • Superior Model Performance: State-of-the-art performance among publicly available code models on HumanEval, MultiPL-E, MBPP, DS-1000, and APPS benchmarks.
  • Advanced Code Completion Capabilities: A window size of 16K and a fill-in-the-blank task, supporting project-level code completion and infilling tasks.

Model Summary

How to Use

This section provides examples of how to use the Deepseek Coder model for code completion, code insertion, and repository-level code completion tasks.

Code Completion

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-5.7bmqa-base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-5.7bmqa-base", trust_remote_code=True).cuda()

input_text = "#write a quick sort algorithm"
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_length=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Code Insertion

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-5.7bmqa-base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-5.7bmqa-base", trust_remote_code=True).cuda()

input_text = """<|begin|>def quick_sort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[0]
    left = []
    right = []
<|hole|>
    if arr[i] < pivot:
        left.append(arr[i])
    else:
        right.append(arr[i])
return quick_sort(left) + [pivot] + quick_sort(right)<|end|>"""

inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_length=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True)[len(input_text):])

Repository Level Code Completion

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-5.7bmqa-base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-5.7bmqa-base", trust_remote_code=True).cuda()

input_text = """#utils.py
import torch
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import accuracy_score

def load_data():
    iris = datasets.load_iris()
    X = iris.data
    y = iris.target

    # Standardize the data
    scaler = StandardScaler()
    X = scaler.fit_transform(X)

    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)

    # Convert numpy data to PyTorch tensors
    X_train = torch.tensor(X_train, dtype=torch.float32)
    X_test = torch.tensor(X_test, dtype=torch.float32)
    y_train = torch.tensor(y_train, dtype=torch.int64)
    y_test = torch.tensor(y_test, dtype=torch.int64)

     return X_train, X_test, y_train, y_test

def evaluate_predictions(y_test, y_pred):
    return accuracy_score(y_test, y_pred)
#model.py
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset

class IrisClassifier(nn.Module):
    def __init__(self):
        super(IrisClassifier, self).__init__()
        self.fc = nn.Sequential(
            nn.Linear(4, 16),
            nn.ReLU(),
            nn.Linear(16, 3)
        )

    def forward(self, x):
        return self.fc(x)

    def train_model(self, X_train, y_train, epochs, lr, batch_size):
        criterion = nn.CrossEntropyLoss()
        optimizer = optim.Adam(self.parameters(), lr=lr)

        # Create DataLoader for batches
        dataset = TensorDataset(X_train, y_train)
        dataloader = DataLoader(dataset, batch_size=batch_size, shuffle=True)

        for epoch in range(epochs):
            for batch_X, batch_y in dataloader:
                optimizer.zero_grad()
                outputs = self(batch_X)
                loss = criterion(outputs, batch_y)
                loss.backward()
                optimizer.step()

    def predict(self, X_test):
        with torch.no_grad():
            outputs = self(X_test)
            _, predicted = outputs.max(1)
        return predicted.numpy()
#main.py
from utils import load_data, evaluate_predictions
from model import IrisClassifier as Classifier

def main():
    # Model training and evaluation
"""

inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=140)
print(tokenizer.decode(outputs[0]))

License

This code repository is licensed under the MIT License. The use of Deepseek Coder models is subject to the Model License. DeepSeek Coder supports commercial use.

See the LICENSE-MODEL for more details.

Contact

If you have any questions, please raise an issue or contact us at agi_code@deepseek.com.

Suggested labels

{ "key": "llm-experiments", "value": "Experiments and results related to Large Language Models" } { "key": "AI-Chatbots", "value": "Topics related to advanced chatbot platforms integrating multiple AI models" }

#488: Can Ai Code Results - a Hugging Face Space by mike-ravkine

### DetailsSimilarity score: 0.87 - [ ] [Can Ai Code Results - a Hugging Face Space by mike-ravkine](https://huggingface.co/spaces/mike-ravkine/can-ai-code-results)

Can Ai Code Results - a Hugging Face Space by mike-ravkine

Description

hallucinations

[Can Ai Code Results](https://huggingface.co/spaces/mike-ravkine/can-ai-code-results)

This is a Hugging Face Space showcasing the results of an experiment to determine if AI can generate code. The Space uses a model fine-tuned on a dataset of code to predict what code should come next given a prompt.

You can try out the model in the Interactive Mode or check out the code in the Static Mode.

Interactive Mode

In the Interactive Mode, you can enter a prompt and the model will generate some code for you. Here are some example prompts:

  • def hello_world():
  • class MyClass:
  • function factorial(n):

Static Mode

In the Static Mode, you can see examples of code generated by the model. You can also see the true code and compare it to the AI's code.

Dataset

The dataset used to fine-tune the model is called The Human Evaluated Dataset of Code Completions. It contains 5,000 examples of code from 5 programming languages:

  • Python
  • JavaScript
  • Java
  • C#
  • Ruby

Each example in the dataset has the following structure:

  • <function name or class name>
  • <code snippet>
  • <true code>

Model

The model used in this Space is a Transformer-based model. It was fine-tuned on the Human Evaluated Dataset of Code Completions for 10 epochs.

Conclusion

After running this experiment, it seems that AI can generate code that is fairly similar to human-written code. However, there is still room for improvement as the AI's code is not always perfect.

Nevertheless, this Space demonstrates the potential of using AI to assist with coding tasks. It could be useful for generating code snippets or for helping beginners learn programming.

Suggested labels

{ "label-name": "ai-technology", "description": "Content related to AI technology.", "confidence": 94.84 }

@irthomasthomas
Copy link
Owner Author

Related content

#682 - Similarity score: 1.0

#305 - Similarity score: 0.89

#656 - Similarity score: 0.88

#96 - Similarity score: 0.88

#418 - Similarity score: 0.88

#383 - Similarity score: 0.87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI-Chatbots Topics related to advanced chatbot platforms integrating multiple AI models Algorithms Sorting, Learning or Classifying. All algorithms go here. code-generation code generation models and tools like copilot and aider New-Label Choose this option if the existing labels are insufficient to describe the content accurately openai OpenAI APIs, LLMs, Recipes and Evals RAG Retrieval Augmented Generation for LLMs technical-writing Links to deep technical writing and books
Projects
None yet
Development

No branches or pull requests

1 participant