一、软件下载
文末提供程序和源码下载
Gaia 是一个去中心化的计算基础设施,使每个人都能够创建、部署、扩展和货币化自己的 AI 代理,这些代理反映了他们的风格、价值观、知识和专长。
它允许个人和企业创建 AI 代理。每个 Gaia 节点都提供:
- 一个基于 Web 的聊天机器人 UI Chat,与 Gaia 节点进行 Rust 编程语言专家的对话。
- 一个与 OpenAI 兼容的 API。了解如何在您最喜欢的 AI 代理应用程序中使用 Gaia 节点作为 OpenAI 的直接替代品。
当今 AI 代理的 100% 是 OpenAI 生态系统中的应用程序。通过我们的 API 方法,Gaia 是 OpenAI 的替代品。每个 Gaia 节点都能够使用微调模型进行定制,并辅以领域知识,从而消除了许多人所期望的通用响应。例如,金融分析师代理的 Gaia 节点可以编写 SQL 代码来查询 SEC 10K 文件以回答用户问题。
类似的 Gaia 节点被组织到 Gaia 域中,通过跨节点的负载均衡来提供稳定的服务。Gaia 域具有面向公众的 URL,并向其社区推广代理服务。当用户或代理应用程序向域的 API 终端节点 URL 发送 API 请求时,域负责将请求定向到准备就绪的节点。
二、快速入门
- 在 Mac、Linux 或 Windows WSL 上只需一行命令即可安装默认节点软件栈。
-
curl -sSfL 'https://github.com/GaiaNet-AI/gaianet-node/releases/latest/download/install.sh' | bash
- 初始化节点。这将下载
$HOME/gaianet/config.json
文件中指定的模型文件和向量数据库文件,由于文件较大,可能需要几分钟时间。 -
gaianet init
- 启动节点。
-
gaianet start
- 脚本会在控制台上显示官方节点地址,如下所示。
- 您可以打开浏览器访问该 URL,查看节点信息并与节点上的人工智能代理聊天。
-
... ... https://0xf63939431ee11267f4855a166e11cc44d24960c0.us.gaianet.network
- 要停止节点,可以运行以下脚本。
-
gaianet stop
三、安装指南
curl -sSfL 'https://raw.githubusercontent.com/GaiaNet-AI/gaianet-node/main/install.sh' | bash
输出结果应如下所示:
[+] Downloading default config file ... [+] Downloading nodeid.json ... [+] Installing WasmEdge with wasi-nn_ggml plugin ... Info: Detected Linux-x86_64 Info: WasmEdge Installation at /home/azureuser/.wasmedge Info: Fetching WasmEdge-0.13.5 /tmp/wasmedge.2884467 ~/gaianet ######################################################################## 100.0% ~/gaianet Info: Fetching WasmEdge-GGML-Plugin Info: Detected CUDA version: /tmp/wasmedge.2884467 ~/gaianet ######################################################################## 100.0% ~/gaianet Installation of wasmedge-0.13.5 successful WasmEdge binaries accessible The WasmEdge Runtime wasmedge version 0.13.5 is installed in /home/azureuser/.wasmedge/bin/wasmedge. [+] Installing Qdrant binary... * Download Qdrant binary ################################################################################################## 100.0% * Initialize Qdrant directory [+] Downloading the rag-api-server.wasm ... ################################################################################################## 100.0% [+] Downloading dashboard ... ################################################################################################## 100.0%
默认情况下,它会安装到 $HOME/gaianet
目录中。您也可以选择安装在其他目录下。
curl -sSfL 'https://raw.githubusercontent.com/GaiaNet-AI/gaianet-node/main/install.sh' | bash -s -- --base $HOME/gaianet.alt
四、初始化节点
gaianet init
输出结果应如下所示:
[+] Downloading Llama-2-7b-chat-hf-Q5_K_M.gguf ... ############################################################################################################################## 100.0%############################################################################################################################## 100.0% [+] Downloading all-MiniLM-L6-v2-ggml-model-f16.gguf ... ############################################################################################################################## 100.0%############################################################################################################################## 100.0% [+] Creating 'default' collection in the Qdrant instance ... * Start a Qdrant instance ... * Remove the existed 'default' Qdrant collection ... * Download Qdrant collection snapshot ... ############################################################################################################################## 100.0%############################################################################################################################## 100.0% * Import the Qdrant collection snapshot ... * Recovery is done successfully
init
命令根据 $HOME/gaianet/config.json
文件初始化节点。您可以使用我们的一些预设配置。例如,下面的命令初始化了一个用 llama-3 8B 模型加上伦敦旅游指南作为知识库的节点。
gaianet init --config https://raw.githubusercontent.com/GaiaNet-AI/node-configs/main/llama-3-8b-instruct_london/config.json
要查看预设配置列表,可以执行 gaianet init --help
命令。
除了像 gaianet_docs
这样的预设配置外,您还可以向 config.json
传递一个 URL,以便将节点初始化为你想要的状态。
如果需要 init
安装在其他目录下的节点,可以这样做:
gaianet init --base $HOME/gaianet.alt
五、启动节点
gaianet start
输出结果应如下所示:
[+] Starting Qdrant instance ... Qdrant instance started with pid: 39762 [+] Starting LlamaEdge API Server ... Run the following command to start the LlamaEdge API Server: wasmedge --dir .:./dashboard --nn-preload default:GGML:AUTO:Llama-2-7b-chat-hf-Q5_K_M.gguf --nn-preload embedding:GGML:AUTO:all-MiniLM-L6-v2-ggml-model-f16.gguf rag-api-server.wasm --model-name Llama-2-7b-chat-hf-Q5_K_M,all-MiniLM-L6-v2-ggml-model-f16 --ctx-size 4096,384 --prompt-template llama-2-chat --qdrant-collection-name default --web-ui ./ --socket-addr 0.0.0.0:8080 --log-prompts --log-stat --rag-prompt "Use the following pieces of context to answer the user's question.\nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n----------------\n" LlamaEdge API Server started with pid: 39796
您可以在本地启动节点。它只能通过 localhost
访问,而不能通过 GaiaNet 域的公共 URL 访问。
gaianet start --local-only
您也可以启动安装在其他目录下的节点。
gaianet start --base $HOME/gaianet.alt
六、停止节点
gaianet stop
输出结果应如下所示:
[+] Stopping WasmEdge, Qdrant and frpc ...
停止安装在其他目录下的节点。
gaianet stop --base $HOME/gaianet.alt
七、更新配置
使用 gaianet config
子命令可以更新 config.json
文件中定义的字段。更新配置后,必须再次运行 gaianet init
。
例如,要更新 chat
字段,请使用以下命令:
gaianet config --chat-url "https://huggingface.co/second-state/Llama-2-13B-Chat-GGUF/resolve/main/Llama-2-13b-chat-hf-Q5_K_M.gguf"
例如,要更新 chat_ctx_size
字段,请使用以下命令:
gaianet config --chat-ctx-size 5120
以下是 config
子命令的所有选项。
$ gaianet config --help Usage: gaianet config [OPTIONS] Options: --chat-url <url> Update the url of chat model. --chat-ctx-size <val> Update the context size of chat model. --embedding-url <url> Update the url of embedding model. --embedding-ctx-size <val> Update the context size of embedding model. --prompt-template <val> Update the prompt template of chat model. --port <val> Update the port of LlamaEdge API Server. --system-prompt <val> Update the system prompt. --rag-prompt <val> Update the rag prompt. --rag-policy <val> Update the rag policy [Possible values: system-message, last-user-message]. --reverse-prompt <val> Update the reverse prompt. --domain <val> Update the domain of GaiaNet node. --snapshot <url> Update the Qdrant snapshot. --qdrant-limit <val> Update the max number of result to return. --qdrant-score-threshold <val> Update the minimal score threshold for the result. --base <path> The base directory of GaiaNet node. --help Show this help message
八、软件下载
本文信息来源于GitHub作者地址:GitHub - GaiaNet-AI/gaianet-node: Install and run your own AI agent service