🎉 Prem Challenge🎉

🎉 Prem 挑战赛🎉

6 分钟阅读

我们很高兴地宣布由 Prem 与 LangChain 合作举办的挑战赛。

在 LangChain,我们努力尽可能方便地试验尽可能多的不同模型,包括大量涌现的开源模型。我们已努力使我们的框架尽可能适用于开源模型的实验。这已经促成了几个建立在 LangChain 和开源模型之上的惊人项目。

我们希望看到更多这类项目!这就是为什么我们如此兴奋地分享 Prem 创建的这项挑战赛。我们还将此作为突出我们与 Prem 集成的机会。我们将共同帮助开发者构建新一代 AI 应用,这些应用利用 LangChain 的可组合性和 Prem 以隐私为中心的 AI 模型部署。

关于 Prem

Prem 利用最先进的开源大型语言模型 (LLM),提供统一的环境,在您的基础设施上部署 AI 模型。它抽象化了 AI 部署的所有技术复杂性,开创了以隐私为中心的 AI 应用的新时代 — 用户可以保留对其模型的控制权和所有权。

一键集成

所有 Prem AI 服务都以与 OpenAI 相同的方式公开 API。一起使用这些工具非常简单,只需下载 Prem App 并调整您的 API 应用程序的 URL 以指向 Prem AI 服务,这些服务在本地使用您选择的模型运行。

如果您习惯使用 LangChain,现在您可以用 Prem 增强它。构建 AI 应用程序,而无需将敏感数据传输给任何第三方。

正确的抽象

如今,托管和部署开源模型令人头疼。您需要

  • 为您的特定用例选择和测试模型。
  • 使用可用的多个 Web 框架之一来服务模型。
  • 打包服务以供生产使用。

感谢 Prem,我们通过一键部署模型和向量存储,消除了所有这些痛点。因此,今天,如果您正在将 LangChain 与 OpenAI 一起使用,并希望切换到自托管的隐私保护解决方案,您只需安装 Prem 即可。然后,由于 Prem 公开了与 OpenAI 相同的 API,您可以轻松使用任何 OpenAI 类,只需更改 api_base

from langchain.chat_models import ChatOpenAI


chat = ChatOpenAI(openai_api_base="http://localhost:8111/api/v1", max_tokens=128)

Prem 挑战赛概述

Prem Labs 旨在培育一个隐私保护应用程序的生态系统。我们很高兴地宣布这项挑战赛,以激励开发者社区构建创新的应用程序、服务和解决方案,将用户隐私放在首位。

参与挑战赛的团队将利用 Prem 在本地部署 AI 模型和服务。一个重要的要求是,提交的应用程序在其堆栈的任何时候都不应依赖集中式 API。

内容

🛠 参与挑战赛的团队将使用一个或多个 Prem AI 服务开发移动、桌面或 Web 应用程序。自托管 AI 模型具有多项优势,包括效率、成本优化和隐私。

要了解有关挑战赛的更多信息并查看一些参考实现,请访问我们的基本教程,以快速了解 Prem

时间

📆 6月26日 - 7月10日

地点

🌍 任何地方,虚拟

人数?

🚶🚶🚶 接受个人和团队参赛。团队最多可由 4 人组成。

奖品

评委将评选出并奖励 3 个最佳提交应用程序。💰最终入选项目将获得高达 10,000 美元以上的奖励。

提交要求

要获得挑战赛资格,您的应用程序应满足以下条件

  1. 开源 Github 存储库 因为 Prem 从一开始就是开源的。此外,应用程序和服务的所有部分都必须是开源的。
  2. 使用 Prem 服务 从您本地机器上的开发到生产远程服务器,都使用相同的接口、API 和服务。
  3. 不要在您的服务器或第三方记录用户数据 在堆栈的任何时候都没有集中式 API!您的用户希望您保护他们的数据隐私!

评判标准

  1. 提示词利用率 我们都知道开源模型尚未达到 OpenAI 那样的水平,后者拥有强大的 GPU 可供支配:从约束中,人类可以发挥创造力来产生意想不到的结果。在提示词方面要聪明。
  2. 商用硬件 如果我们想将 AI 的好处带给全球南方数十亿人,而不将他们锁定在老大哥的视线中,我们必须绕过它,并确保任何人都能负担得起计算资源。在没有 GPU 或非常便宜的 VPS 上运行您的应用程序。
  3. 可组合性 组合所有 Prem 服务:LLM、Diffuser、Embedding 和向量存储。
  4. 生产状态 您的应用程序有多完善?我的祖母会用吗?

提交过程

7月10日 - UTC 时间下午 6 点之前 google form 链接

在 Github 上表达对 Prem App 的喜爱

在 Twitter 上关注我们 - https://twitter.com/premai_io

加入我们的 Discord - https://discord.com/invite/kpKk6vYVAn

入门指南

安装 Prem

您可以通过两种不同的方式运行 Prem

  • MacOS:访问 https://premai.io 并下载 Prem App。
  • 服务器:运行安装脚本:wget -q <https://get.prem.ninja/install.sh> -O install.sh; sudo bash ./install.sh

在 GUI 中运行服务

当 UI 启动并运行时,您可以看到所有可用的服务。只需单击一下,您就可以下载您感兴趣的服务。在后台,与服务关联的 docker 镜像将根据您的硬件要求下载。

在等待下载完成时,在详细视图中阅读有关该服务的更多信息。只需单击卡片,您将被重定向到服务页面。每个服务页面都包含一些通用信息以及完整的文档,其中提供了有关公开模型的更多详细信息。下载完成后,只需单击“打开”,服务将启动。您可以从 playground 或 API 与服务进行交互。

您可以从服务详细视图中查看服务运行的端口。

开始构建您的应用

现在服务正在运行,您可以连接到 http://localhost:8111 并开始构建。这是一个使用 LangChain 连接到服务的简单代码片段。

import os

from langchain.chat_models import ChatOpenAI
from langchain.schema import AIMessage, HumanMessage

os.environ["OPENAI_API_KEY"] = "random-string"

chat = ChatOpenAI(openai_api_base="<http://localhost:8111/api/v1>", max_tokens=128)

messages = [
    HumanMessage(content="Can you explain what is a large language model?")
]
chat(messages)
Certainly! A large language model is a type of machine learning algorithm that has been trained on a very large dataset of text to learn how to generate human-like language. These models can be used for tasks such as text generation, question answering, and natural language processing. In this project, we will use the Hugging Face Transformers library to train a large language model on a dataset of text and then fine-tune it on a smaller dataset of text related to fashion and beauty.
messages = [
    HumanMessage(content="Write me a story about a superstar.")
]
chat(messages)
Once upon a time, there was a young woman who had always dreamed of becoming a star. She sang like a bird, danced like a dream, and captivated every audience she performed for with her sheer talent and charm.

When she was just starting out, she worked tirelessly to make her mark on the music industry, taking any opportunity that came her way and honing her skills day by day. Finally, after years of hard work and dedication, she was offered a record deal and shot to fame almost overnight, becoming an instant superstar in the process.

People everywhere were captivated by this talented young woman, who seemed to have it all: the voice, the looks, the style, and the stage presence that left audiences begging for more. She quickly became a household name, known for her infectious smile, her magnetic energy, and the way she made everyone feel like they knew her personally.

As she continued to tour and perform, the superstar began to accumulate an enormous following, with fans from all

完成 🎉 您现在正在将 Prem 与 LangChain 一起使用。

更多信息

查看我们的文档:https://github.com/premai-io/prem-app

查看一个简单的与您的数据对话的 notebook:https://github.com/premAI-io/prem-daemon/blob/main/resources/notebooks/talk_to_your_data.ipynb

查看我们的 YouTube 教程