偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 原創(chuàng)

發(fā)布于 2024-7-15 07:30
瀏覽
0收藏

在數(shù)據(jù)安全和隱私保護(hù)日益受到重視的背景下,私有化部署大模型的需求日益增長。Mintplex Labs Inc. 推出的開源項目 AnythingLLM,為個人和企業(yè)提供了一種安全、高效且可定制的解決方案。該工具基于RAG(Retrieval-Augmented Generation)模型,允許用戶將本地文檔轉(zhuǎn)換為可由大型語言模型(LLM)引用的格式,實現(xiàn)對話式問答和知識管理。

一、AnythingLLM的主要功能

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

  • 多用戶支持與權(quán)限管理:支持多用戶同時訪問,并可設(shè)置不同權(quán)限。
  • 文檔管理:支持PDF、TXT、DOCX等多種文檔類型,并通過簡易界面管理。
  • 聊天模式:提供對話和查詢兩種模式,保留歷史記錄,支持引用標(biāo)注。
  • 技術(shù)棧簡單:便于快速迭代和云部署。
  • 成本效益:對大型文檔一次性嵌入,顯著節(jié)約成本。
  • 開發(fā)者API:提供完整API支持自定義集成。
  • LLM:包括任何開源的 llama.cpp 兼容模型、OpenAI、Azure OpenAI、Anthropic ClaudeV2、LM Studio 和 LocalAi。
  • 嵌入模型:AnythingLLM 原生嵌入器、OpenAI、Azure OpenAI、LM Studio 和 LocalAi。
  • 向量數(shù)據(jù)庫:LanceDB(默認(rèn))、Pinecone、Chroma、Weaviate 和 QDrant。

二、AnythingLLM 部署實戰(zhàn)

1. 安裝Chroma Vectorstore:通過Docker容器部署,創(chuàng)建集合并驗證設(shè)置。

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

訪問向量存儲API文檔: http://localhost:8000/docs

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

2. LocalAI部署:使用CLI應(yīng)用程序啟動API服務(wù)器,與開源模型交互。

git clone https://github.com/go-skynet/LocalAI
cd chroma
docker compose up -d --build

容器運行后,我們需要下載、安裝模型以供測試使用

Bert 的轉(zhuǎn)換器嵌入模型:MiniLM L6

curl http://localhost:8080/models/apply 
  -H "Content-Type: application/json"
  -d '{ "id": "model-gallery@bert-embeddings" }'


curl http://localhost:8080/v1/embeddings 
  -H "Content-Type: application/json"
  -d '{ "input": "The food was delicious and the waiter...",
"model": "bert-embeddings" }'


{
"created": 1702050873,
"object": "list",
"id": "b11eba4b-d65f-46e1-8b50-38d3251e3b52",
"model": "bert-embeddings",
"data": [
    {
"embedding": [
        -0.043848168,
0.067443006,
    ...
0.03223838,
0.013112408,
0.06982294,
        -0.017132297,
        -0.05828256
      ],
"index": 0,
"object": "embedding"
    }
  ],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
 }
}

大模型LLM:Zephyr-7B-β

curl http://localhost:8080/models/apply 
  -H "Content-Type: application/json" 
  -d '{ "id": "huggingface@thebloke__zephyr-7b-beta-gguf__zephyr-7b-beta.q4_k_s.gguf", 
        "name": "zephyr-7b-beta" }'


curl http://localhost:8080/v1/chat/completions 
  -H "Content-Type: application/json" 
  -d '{ "model": "zephyr-7b-beta", 
        "messages": [{
          "role": "user", 
          "content": "Why is the Earth round?"}], 
        "temperature": 0.9 }'


{
  "created": 1702050808,
  "object": "chat.completion",
  "id": "67620f7e-0bc0-4402-9a21-878e4c4035ce",
  "model": "thebloke__zephyr-7b-beta-gguf__zephyr-7b-beta.q4_k_s.gguf",
  "choices": [
    {
      "index": 0,
      "finish_reason": "stop",
      "message": {
        "role": "assistant",
        "content": "\nThe Earth appears round because it is
actually a spherical body. This shape is a result of the 
gravitational forces acting upon it from all directions. The force 
of gravity pulls matter towards the center of the Earth, causing 
it to become more compact and round in shape. Additionally, the 
Earth's rotation causes it to bulge slightly at the equator, 
further contributing to its roundness. While the Earth may appear 
flat from a distance, up close it is clear that our planet is 
indeed round."
      }
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}

3. 部署AnythingLLM:利用官方Docker鏡像安裝,然后配置LocalAI后端和嵌入模型。

docker pull mintplexlabs/anythingllm:master


export STORAGE_LOCATION="/var/lib/anythingllm" && \
mkdir -p $STORAGE_LOCATION && \
touch "$STORAGE_LOCATION/.env" && \
docker run -d -p 3001:3001 \
-v ${STORAGE_LOCATION}:/app/server/storage \
-v ${STORAGE_LOCATION}/.env:/app/server/.env \
-e STORAGE_DIR="/app/server/storage" \
mintplexlabs/anythingllm:master

訪問:???http://localhost:3001??,我們可以在其中使用直觀的 GUI 開始配置。

LocalAI 后端配置:通過 http://172.17.0.1:8080/v1 URL 訪問

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

嵌入模型配置與相同的 LocalAI 后端保持一致。

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

接下來,配置 Chroma 向量數(shù)據(jù)庫,使用URL http://172.17.0.1:8000

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

創(chuàng)建一個工作區(qū),命名為“Playground”。

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

在“Playground”工作區(qū),我們可以上傳文檔,進(jìn)一步擴(kuò)展本地知識庫。

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

至此我們能夠與文檔開始進(jìn)行交互式對話。

打造智能私有知識庫:開源工具AnythingLLM全解析及實操指南,RAG企業(yè)級解決方案 -AI.x社區(qū)

總結(jié):

AnythingLLM和Vector Admin是Mintplex Labs提供的創(chuàng)新開源工具,它們極大地簡化了私有知識庫的構(gòu)建和管理。通過高效的RAG模型實現(xiàn)和直觀的用戶界面,這些工具不僅保障了數(shù)據(jù)的安全性,同時也提供了強大的交互式文檔處理能力。隨著技術(shù)的不斷進(jìn)步,這些工具將為企業(yè)和個人用戶提供更多的可能性和價值。

了解更多詳情:

AnythingLLM GitHub: https://github.com/Mintplex-Labs/anything-llm

LocalAI Docs: https://localai.io/

AnythingLLM: https://useanything.com/


本文轉(zhuǎn)載自公眾號頂層架構(gòu)領(lǐng)域

原文鏈接:????https://mp.weixin.qq.com/s/KHeWJUIRFqygPs6fVOES7A??



?著作權(quán)歸作者所有,如需轉(zhuǎn)載,請注明出處,否則將追究法律責(zé)任
標(biāo)簽
2
收藏
回復(fù)
舉報
1條回復(fù)
按時間正序
/
按時間倒序
Elina孫
Elina孫

姐不白看,姐給你點贊

回復(fù)
2024-7-16 23:21:04
回復(fù)
相關(guān)推薦