ARCH是一個智能層的7層分佈式代理,旨在使用API保護,觀察和個性化AI代理。
Arch採用專門構建的LLM設計,處理與提示的處理和處理有關的關鍵但未分化的任務,包括檢測和拒絕越獄嘗試,聰明地稱呼“後端” API來滿足用戶的請求,以提示並在上升llms之間進行災難恢復和在上升的互動中提供災難恢復和管理互動的互動和LLM的互動方式。
拱門建立在特使的(並由)代理的核心貢獻者基於:
提示是細微的和不透明的用戶請求,它需要與傳統的HTTP請求相同的功能,包括安全處理,智能路由,可觀察到的可觀察性以及與後端(API)的個性化系統集成在一起的系統 - 所有外部業務邏輯。
核心功能:
跳到我們的文檔,了解如何使用Arch提高Genai應用程序的速度,安全性和個性化。
重要的
如今,為代理和抹布方案設計的名稱LLM(拱門功能)在美國中央地區免費託管。為了提供一致的延遲和吞吐量,為了管理我們的費用,我們將盡快通過開發人員鍵訪問託管版本,並為您提供本地運行該LLM的選項。有關更多詳細信息,請參見此問題#258
要與我們聯繫,請加入我們的Discord服務器。我們將在那裡積極監控並提供支持。
遵循本指南,了解如何快速設置ARCH並將其集成到生成AI應用程序中。
在開始之前,請確保您有以下內容:
Docker
& Python
已安裝在您的系統上API Keys
(如果使用外部LLMS)Arch的CLI允許您有效地管理和與拱門網關進行交互。要安裝CLI,只需運行以下命令:提示:我們建議開發人員在安裝ARCH之前創建一個新的Python虛擬環境來隔離依賴項。這樣可以確保ARGGW及其依賴關係不會干擾系統上的其他軟件包。
確保您在進一步繼續前進之前已安裝了遵循公用事業,
$ python -m venv venv
$ source venv/bin/activate # On Windows, use: venvScriptsactivate
$ pip install archgw
Arch根據配置文件進行操作,您可以在其中定義LLM提供程序,提示目標,護欄等。
version : v0.1
listener :
address : 127.0.0.1
port : 8080 # If you configure port 443, you'll need to update the listener with tls_certificates
message_format : huggingface
# Centralized way to manage LLMs, manage keys, retry logic, failover and limits in a central way
llm_providers :
- name : OpenAI
provider : openai
access_key : $OPENAI_API_KEY
model : gpt-3.5-turbo
default : true
# default system prompt used by all prompt targets
system_prompt : |
You are a network assistant that helps operators with a better understanding of network traffic flow and perform actions on networking operations. No advice on manufacturers or purchasing decisions.
prompt_targets :
- name : device_summary
description : Retrieve network statistics for specific devices within a time range
endpoint :
name : app_server
path : /agent/device_summary
parameters :
- name : device_ids
type : list
description : A list of device identifiers (IDs) to retrieve statistics for.
required : true # device_ids are required to get device statistics
- name : days
type : int
description : The number of days for which to gather device statistics.
default : " 7 "
- name : reboot_devices
description : Reboot a list of devices
endpoint :
name : app_server
path : /agent/device_reboot
parameters :
- name : device_ids
type : list
description : A list of device identifiers (IDs).
required : true
- name : days
type : int
description : A list of device identifiers (IDs)
default : " 7 "
# Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem.
endpoints :
app_server :
# value could be ip address or a hostname with port
# this could also be a list of endpoints for load balancing
# for example endpoint: [ ip1:port, ip2:port ]
endpoint : host.docker.internal:18083
# max time to wait for a connection to be established
connect_timeout : 0.005s
通過拱門進行撥打電話
from openai import OpenAI
# Use the OpenAI client as usual
client = OpenAI (
# No need to set a specific openai.api_key since it's configured in Arch's gateway
api_key = '--' ,
# Set the OpenAI API base URL to the Arch gateway endpoint
base_url = "http://127.0.0.1:12000/v1"
)
response = client . chat . completions . create (
# we select model from arch_config file
model = "--" ,
messages = [{ "role" : "user" , "content" : "What is the capital of France?" }],
)
print ( "OpenAI Response:" , response . choices [ 0 ]. message . content )
Arch旨在通過支持開放標準來支持最佳的課堂可觀察性。請閱讀有關可觀察性的文檔,以了解有關跟踪,指標和日誌的更多詳細信息
我們希望在路線圖上的反饋,我們歡迎對Arch的貢獻!無論您是修復錯誤,添加新功能,改進文檔還是創建教程,都非常感謝您的幫助。請訪問我們的貢獻指南以獲取更多詳細信息