9 个开源精华助您成为终极开发者🔥 🚀

2025-05-25

9 个开源精华助您成为终极开发者🔥 🚀

TL;DR

对我来说,人工智能无处不在。
但有时,我很难理解哪些项目有趣,哪些项目适合用在你的网站上。

我整理了一份包含 9 个开源存储库的列表,您明天就可以将它们纳入您的存储库中!

恶搞之家 GIF


1. Composio 👑 - 为您的 AI 代理提供一体化工具解决方案

我之前构建过 AI 代理,但是当需要连接 GitHub、Slack 和 Jira 等第三方服务以实现复杂的 AI 自动化时,我找不到一个可用的工具——直到我发现了Composio

它是一个开源平台,提供 100 多种跨行业垂直工具和集成,从 CRM、HRM、社交媒体到开发和生产力。

Composio 集成仪表板

它们处理复杂的用户身份验证,例如 OAuth、ApiKey 等,因此您只需专注于构建高效而复杂的 AI 自动化。

它们对 Python 和 Javascript 有原生支持。

您可以通过使用 安装来快速开始使用 Composio pip



pip install composio-core


Enter fullscreen mode Exit fullscreen mode

添加 GitHub 集成。



composio add github


Enter fullscreen mode Exit fullscreen mode

Composio 代表您处理用户身份验证和授权。

以下是如何使用 GitHub 集成来为存储库加注星标的方法。



from openai import OpenAI
from composio_openai import ComposioToolSet, App 

openai_client = OpenAI(api_key="******OPENAIKEY******")

# Initialise the Composio Tool Set
composio_toolset = ComposioToolSet(api_key="**\\*\\***COMPOSIO_API_KEY**\\*\\***")

## Step 4
# Get GitHub tools that are pre-configured
actions = composio_toolset.get_actions(actions=[Action.GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER])

## Step 5
my_task = "Star a repo ComposioHQ/composio on GitHub"

# Create a chat completion request to decide on the action
response = openai_client.chat.completions.create(
model="gpt-4-turbo",
tools=actions, # Passing actions we fetched earlier.
messages=[
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": my_task}
  ]
)



Enter fullscreen mode Exit fullscreen mode

运行此 Python 脚本以使用代理执行给定的指令。

有关 Composio 的更多信息,请访问其文档。

作曲 GIF

为 Composio 代码库加星标 ⭐


2. LLMWare——面向复杂企业的人工智能

构建 AI 原型是一回事,但将其部署到企业用例中又是另一回事。

解决方案需要安全、稳健且坚不可摧。LLMWare 是一个框架,能够让您自信地构建企业 AI 应用。

它们让您快速构建超高效的 AI 代理、企业 RAG 和其他工作流程。

LLMWare 有两个主要组件:

  1. RAG 管道 ——将知识源与生成 AI 模型连接起来的集成组件。
  2. 50 多个小型、专用模型 针对企业流程自动化中的关键任务进行了微调,包括基于事实的问答、分类、总结和提取。

开始使用 LLMWare 很容易。



pip3 install llmware


Enter fullscreen mode Exit fullscreen mode

这是 LLMWare 中数据检索的一个简单示例。




"""This example demonstrates the various ways to retrieve data from libraries:
      1. Create a sample library (e.g., UN Resolutions)
      2. Execute a Text Query with Author Name Filter
      3. Display Results
"""

import os
from llmware.library import Library
from llmware.retrieval import Query
from llmware.setup import Setup

def create_un_500_sample_library(library_name):

    library = Library().create_new_library(library_name)
    sample_files_path = Setup().load_sample_files(over_write=False)
    ingestion_folder_path = os.path.join(sample_files_path, "UN-Resolutions-500")
    parsing_output = library.add_files(ingestion_folder_path)

    return library

def text_retrieval_by_author(library, query_text, author):

    #   create a Query instance and pass the previously created Library object
    query = Query(library)

    #   set the keys that should be returned in the results
    query.query_result_return_keys = ["file_source", "page_num", "text", "author_or_speaker"]

    #   perform a text query by author
    query_results = query.text_query_by_author_or_speaker(query_text, author)

    #   display the results
    for i, result in enumerate(query_results):

        file_source = result["file_source"]
        page_num = result["page_num"]
        author = result["author_or_speaker"]
        text = result["text"]

        # shortening for display purpose only
        if len(text) > 150:  text = text[0:150] + " ... "

        print (f"\n> Top result for '{query_text}': {file_source} (page {page_num}), Author: {author}:\nText:{text}")

    return query_results

if __name__ == "__main__":

    library = create_un_500_sample_library("lib_author_filter_1")
    qr_output = text_retrieval_by_author(library=library, query_text='United Nations', author='Andrea Chambers')


Enter fullscreen mode Exit fullscreen mode

探索 如何使用 LLMWare 的示例。更多信息,请 参阅文档

LLMWare 毕业证成绩单【微152 ...】 GIF

为 LLMWare 仓库加星标⭐


3. CopilotKit - 将 AI 集成到你的 Web 应用中

如果您正在寻找将 AI 集成到现有工作流程的方法,那么这就是您的目标。CopilotKit 可让您直接轻松地将 AI 工作流程与任何应用程序集成。

它提供文本区域、弹出窗口、侧边栏和聊天机器人等 React 组件,以增强任何具有 AI 功能的应用程序。

让我们看看如何使用 CopilotKit 构建 AI 聊天机器人。



npm i @copilotkit/react-core @copilotkit/react-ui


Enter fullscreen mode Exit fullscreen mode

配置应用程序提供商

首先,您必须使用提供商包装与您的副驾驶交互的所有组件 <CopilotKit /> 。

使用 <CopilotSidebar /> UI 组件显示 Copilot 聊天侧边栏。您还可以选择其他一些选项,例如 <CopilotPopup /> 和 <CopilotChat />



"use client";

import { CopilotKit } from "@copilotkit/react-core";
import { CopilotSidebar } from "@copilotkit/react-ui";
import "@copilotkit/react-ui/styles.css";

export default function RootLayout({children}) {
  return (
    <CopilotKit publicApiKey="<your-public-api-key>">
      <CopilotSidebar>
        {children}
      </CopilotSidebar>
    </CopilotKit>
  );
}


Enter fullscreen mode Exit fullscreen mode

副驾驶可读状态

为副驾驶提供状态知识。



import { useCopilotReadable } from "@copilotkit/react-core";

export function YourComponent() {
  const { employees } = useEmployees();

  // Define Copilot readable state
  useCopilotReadable({
    description: "List of available users",
    value: users,
  });

  return (
    <>...</>
  );
}


Enter fullscreen mode Exit fullscreen mode

副驾驶行动

让副驾驶使用 useCopilotAction 钩子采取行动。



import { useCopilotReadable, useCopilotAction } from "@copilotkit/react-core";

export function YourComponent() {
  const { employees, selectEmployee } = useEmployees();

  // Define Copilot readable state
  useCopilotReadable({
    description: "List of available users",
    value: users,
  });

  // Define Copilot action
  useCopilotAction({
    name: "Select an employee",
    description: "Select an employee from the list",
    parameters: [
      {
        name: "employeeId",
        type: "string",
        description: "The ID of the employee to select",
        required: true,
      }
    ],
    handler: async ({ employeeId }) => selectEmployee(employeeId),
  });

  return (
    <>...</>
  );
}


Enter fullscreen mode Exit fullscreen mode

您可以查看他们的 文档 以获取更多信息。

办理美国大学文凭【微信8522222】 GIF

为 CopilotKit 代码库加星标⭐


4. Julep - AI 应用的托管后端

构建 AI 应用很快就会变得错综复杂。模型、工具和技术等多个不断变化的组件,使得管理这些应用更具挑战性。

Julep 是 AI 应用程序的托管后端,它通过内置内存(用户管理)和知识(内置 RAG 和上下文管理)简化了超高效 AI 应用程序的构建。

使用以下命令开始 pip 。



pip install julep


Enter fullscreen mode Exit fullscreen mode

它的工作原理如下。



from julep import Client
from pprint import pprint
import textwrap
import os

base_url = os.environ.get("JULEP_API_URL")
api_key = os.environ.get("JULEP_API_KEY")

client = Client(api_key=api_key, base_url=base_url)

#create agent
agent = client.agents.create(
    name="Jessica"
    model="gpt-4",
    tools=[]    # Tools defined here
)
#create a user
user = client.users.create(
    name="Anon",
    about="Average nerdy tech bro/girl spending 8 hours a day on a laptop,
)
#create a session
situation_prompt = """You are Jessica. You're a stuck-up Cali teenager.
You complain about everything. You live in Bel-Air, Los Angeles and
drag yourself to Curtis High School when necessary.
"""
session = client.sessions.create(
    user_id=user.id, agent_id=agent.id, situation=situation_prompt
)
#start a conversation

user_msg = "hey. what do you think of Starbucks?"
response = client.sessions.chat(
    session_id=session.id,
    messages=[
        {
            "role": "user",
            "content": user_msg,
            "name": "Anon",
        }
    ],
    recall=True,
    remember=True,
)

print("\n".join(textwrap.wrap(response.response[0][0].content, width=100)))



Enter fullscreen mode Exit fullscreen mode

它们也支持 Javascript。查看它们的 文档 了解更多信息。

去黑头薄荷酒 GIF

为 Julep 仓库加星标 ⭐


5. Traceloop 的 openLLMetry——轻松实现 AI 监控

构建 AI 应用而不监控 LLM 将是一场灾难。语言模型是不确定的,有时会很棘手,而向用户提供一致价值的唯一方法是持续监控 LLM 的轨迹。

Taceloop 的 OpenLLMetry 是一个开源监控平台,最适合跟踪 AI 工作流程。

OpenLLMetry 可以检测 OpenTelemetry 已经检测的所有内容,包括您的数据库、API 调用等。

此外,他们还构建了一组自定义扩展,用于检测您对 OpenAI 或 Anthropic 或 Vector DB 的调用,例如 Chroma、Pinecone、Qdrant 或 Weaviate。

最简单的入门方法是使用 SDK。如需完整指南,请访问我们的 文档

安装 SDK:



pip install traceloop-sdk


Enter fullscreen mode Exit fullscreen mode

在您的 LLM 应用程序中,要开始检测您的代码,请像这样初始化 Traceloop 跟踪器:



from traceloop.sdk import Traceloop

Traceloop.init() 


Enter fullscreen mode Exit fullscreen mode

就这样。你现在正在用 OpenLLMetry 跟踪你的代码!如果你在本地运行,可能需要禁用批量发送,以便立即看到跟踪结果:



Traceloop.init(disable_batch=True)


Enter fullscreen mode Exit fullscreen mode

更多信息请参阅其文档

追踪循环 GIF

为 OpenLLMetry 仓库加星标⭐


6. Taipy——用 Python 构建 AI Web 应用程序

TaiPy 是一个开源库,用于使用 Python 更快地构建可用于生产的 AI 应用。它可以帮助您快速从简单的试点项目过渡到可用于生产的 Web 应用程序。

这是所有 Python 开发人员的超能力;即使不了解 JavaScript,您也可以构建真实世界的 AI 应用程序。

快速开始使用它 pip



pip install taipy


Enter fullscreen mode Exit fullscreen mode

这个简单的 Taipy 应用程序演示了如何使用 Taipy 创建一个基本的电影推荐系统。



import taipy as tp
import pandas as pd
from taipy import Config, Scope, Gui

# Defining the helper functions

# Callback definition - submits scenario with genre selection
def on_genre_selected(state):
    scenario.selected_genre_node.write(state.selected_genre)
    tp.submit(scenario)
    state.df = scenario.filtered_data.read()

## Set initial value to Action
def on_init(state):
    on_genre_selected(state)

# Filtering function - task
def filter_genre(initial_dataset: pd.DataFrame, selected_genre):
    filtered_dataset = initial_dataset[initial_dataset["genres"].str.contains(selected_genre)]
    filtered_data = filtered_dataset.nlargest(7, "Popularity %")
    return filtered_data

# The main script
if __name__ == "__main__":
    # Taipy Scenario & Data Management

    # Load the configuration made with Taipy Studio
    Config.load("config.toml")
    scenario_cfg = Config.scenarios["scenario"]

    # Start Taipy Core service
    tp.Core().run()

    # Create a scenario
    scenario = tp.create_scenario(scenario_cfg)

    # Taipy User Interface
    # Let's add a GUI to our Scenario Management for a complete application

    # Get list of genres
    genres = [
        "Action", "Adventure", "Animation", "Children", "Comedy", "Fantasy", "IMAX"
        "Romance","Sci-FI", "Western", "Crime", "Mystery", "Drama", "Horror", "Thriller", "Film-Noir","War", "Musical", "Documentary"
    ]

    # Initialization of variables
    df = pd.DataFrame(columns=["Title", "Popularity %"])
    selected_genre = "Action"

    # User interface definition
    my_page = """
# Film recommendation

## Choose your favourite genre
<|{selected_genre}|selector|lov={genres}|on_change=on_genre_selected|dropdown|>

## Here are the top seven picks by popularity
<|{df}|chart|x=Title|y=Popularity %|type=bar|title=Film Popularity|>
    """

    Gui(page=my_page).run()



Enter fullscreen mode Exit fullscreen mode

查看 文档 以了解更多信息。

Taipy Gif

为 Taipy 仓库加星标 ⭐


7. Trigger Dev - 后台作业平台

Trigger. Dev 是一个开源平台和 SDK,可让您创建长时间运行且不会超时的后台作业。只需编写常规异步代码并进行部署,即可避免超时。

它们还能让您可靠地调用 AI API,无超时、自动重试和跟踪。您可以使用现有的 SDK。



import { task } from "@trigger.dev/sdk/v3";
// Generate an image using OpenAI Dall-E 3
export const generateContent = task({
  id: "generate-content",
  retry: {
    maxAttempts: 3,
  },
  run: async ({ theme, description }: Payload) => {
    const textResult = await openai.chat.completions.create({
      model: "gpt-4o",
      messages: generateTextPrompt(theme, description),
    });

    if (!textResult.choices[0]) {
      throw new Error("No content, retrying…");
    }

    const imageResult = await openai.images.generate({
      model: "dall-e-3",
      prompt: generateImagePrompt(theme, description),
    });

    if (!imageResult.data[0]) {
      throw new Error("No image, retrying…");
    }

    return {
      text: textResult.choices[0],
      image: imageResult.data[0].url,
    };
  },
});


Enter fullscreen mode Exit fullscreen mode

触发器开发 GIF

为 Trigger.dev 仓库加星标⭐


8. Milvus——面向 AI 应用的云原生矢量数据库

矢量数据库是构建 AI 应用程序的关键组成部分。它们可以帮助您存储、查询和管理非结构化数据(例如文本、图像、视频和音频)的嵌入。

Milvus 是最好的开源向量数据库之一。它拥有从 HNSW 到量化方法的所有先进的向量存储和查询方法。

他们为大多数语言提供 SDK,例如 Python、Javascript、Go、Rust 等。

以下是如何开始使用 PyMilvus。



pip install --upgrade pymilvus==v2.4.4



Enter fullscreen mode Exit fullscreen mode

要安装用于嵌入操作的模型库,请运行以下命令:



pip install pymilvus[model]


Enter fullscreen mode Exit fullscreen mode

连接到 Milvus



from pymilvus import MilvusClient

client = MilvusClient("http://localhost:19530")

client = MilvusClient(
    uri="http://localhost:19530",
    token="root:Milvus",
    db_name="default"
)

client = MilvusClient(
    uri="http://localhost:19530",
    token="user:password", # replace this with your token
    db_name="default"
)


Enter fullscreen mode Exit fullscreen mode

更多信息请参阅其文档

Milvus

为 Milvus 仓库加星标⭐


9. Postiz——利用人工智能提升你的互联网影响力

开发应用程序是一回事,获得用户又是另一回事。还有什么比社交媒体更能找到潜在客户和用户呢?

Postiz 可帮助您利用人工智能提升社交媒体游戏水平。

它提供管理社交媒体帖子、建立受众群体、获取潜在客户和发展业务所需的一切。

查看存储库以了解更多信息。

邮政信箱 GIF

为 Postiz 存储库加星标⭐


感谢您阅读本文。

如果有任何其他酷炫的 AI 工具或框架帮助您构建应用程序,请在下面的评论中告诉我。

PS欢迎随时在 X 上关注我;我会分享有价值的东西 - 保证!

文章来源:https://dev.to/nevodavid/9-open-source-gems-to-become-the-ultimate-developer-2oj9
PREV
我是如何构建我的开源社交媒体调度工具的……🤯 数据库
NEXT
9 个必须了解的开源工具,让你比 99% 的开发人员更优秀