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的贡献!无论您是修复错误,添加新功能,改进文档还是创建教程,都非常感谢您的帮助。请访问我们的贡献指南以获取更多详细信息