https://github.com/katanemo/arch Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} katanemo / arch Public * Notifications You must be signed in to change notification settings * Fork 9 * Star 176 Arch is an intelligent prompt gateway. Engineered with (fast) LLMs for the secure handling, robust observability, and seamless integration of prompts with APIs - all outside business logic. Built by the core contributors of Envoy proxy, on Envoy. archgw.com License Apache-2.0 license 176 stars 9 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 12 * Pull requests 2 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights katanemo/arch main BranchesTags Go to file Code Folders and files Last commit Last Name Name message commit date Latest commit History 207 Commits .github/workflows .github/workflows arch arch chatbot_ui chatbot_ui crates crates demos demos docs docs model_server model_server www www .dockerignore .dockerignore .gitignore .gitignore .gitmodules .gitmodules .pre-commit-config.yaml .pre-commit-config.yaml LICENSE LICENSE README.md README.md gateway.code-workspace gateway.code-workspace View all files Repository files navigation * README * Apache-2.0 license Arch Gateway Logo Build fast, robust, and personalized AI agents. Arch is an intelligent Layer 7 gateway designed to protect, observe, and personalize LLM applications (agents, assistants, co-pilots) with your APIs. Engineered with purpose-built LLMs, Arch handles the critical but undifferentiated tasks related to the handling and processing of prompts, including detecting and rejecting jailbreak attempts, intelligently calling "backend" APIs to fulfill the user's request represented in a prompt, routing to and offering disaster recovery between upstream LLMs, and managing the observability of prompts and LLM interactions in a centralized way. Arch is built on (and by the core contributors of) Envoy Proxy with the belief that: Prompts are nuanced and opaque user requests, which require the same capabilities as traditional HTTP requests including secure handling, intelligent routing, robust observability, and integration with backend (API) systems for personalization - all outside business logic.* Core Features: * Built on Envoy: Arch runs alongside application servers, and builds on top of Envoy's proven HTTP management and scalability features to handle ingress and egress traffic related to prompts and LLMs. * Function Calling for fast Agentic and RAG apps. Engineered with purpose-built LLMs to handle fast, cost-effective, and accurate prompt-based tasks like function/API calling, and parameter extraction from prompts. * Prompt Guard: Arch centralizes prompt guardrails to prevent jailbreak attempts and ensure safe user interactions without writing a single line of code. * Traffic Management: Arch manages LLM calls, offering smart retries, automatic cutover, and resilient upstream connections for continuous availability. * Standards-based Observability: Arch uses the W3C Trace Context standard to enable complete request tracing across applications, ensuring compatibility with observability tools, and provides metrics to monitor latency, token usage, and error rates, helping optimize AI application performance. Jump to our docs to learn how you can use Arch to improve the speed, security and personalization of your GenAI apps. Contact To get in touch with us, please join our discord server. We will be monitoring that actively and offering support there. Demos * Function Calling - Walk through of critical function calling capabilities * Insurance Agent - Build a full insurance agent with arch * Network Agent - Build a networking co-pilot/agent agent with arch Quickstart Follow this guide to learn how to quickly set up Arch and integrate it into your generative AI applications. Prerequisites Before you begin, ensure you have the following: * Docker & Python installed on your system * API Keys for LLM providers (if using external LLMs) Step 1: Install Arch Arch's CLI allows you to manage and interact with the Arch gateway efficiently. To install the CLI, simply run the following command: Tip: We recommend that developers create a new Python virtual environment to isolate dependencies before installing Arch. This ensures that archgw and its dependencies do not interfere with other packages on your system. $ python -m venv venv $ source venv/bin/activate # On Windows, use: venv\Scripts\activate $ pip install archgw Step 2: Configure Arch with your application Arch operates based on a configuration file where you can define LLM providers, prompt targets, guardrails, etc. Below is an example configuration to get you started: version: v0.1 listen: address: 0.0.0.0 # or 127.0.0.1 port: 10000 # Defines how Arch should parse the content from application/json or text/pain Content-type in the http request 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-4o default: true stream: true # default system prompt used by all prompt targets system_prompt: You are a network assistant that just offers facts; not advice on manufacturers or purchasing decisions. prompt_targets: - name: reboot_devices description: Reboot specific devices or device groups path: /agent/device_reboot parameters: - name: device_ids type: list description: A list of device identifiers (IDs) to reboot. required: false - name: device_group type: str description: The name of the device group to reboot required: false # 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: 127.0.0.1:80 # max time to wait for a connection to be established connect_timeout: 0.005s Step 3: Using OpenAI Client with Arch as an Egress Gateway Make outbound calls via Arch import openai # Set the OpenAI API base URL to the Arch gateway endpoint openai.api_base = "http://127.0.0.1:51001/v1" # No need to set openai.api_key since it's configured in Arch's gateway # Use the OpenAI client as usual response = openai.Completion.create( model="text-davinci-003", prompt="What is the capital of France?" ) print("OpenAI Response:", response.choices[0].text.strip()) Observability Arch is designed to support best-in class observability by supporting open standards. Please read our docs on observability for more details on tracing, metrics, and logs Contribution We would love feedback on our Roadmap and we welcome contributions to Arch! Whether you're fixing bugs, adding new features, improving documentation, or creating tutorials, your help is much appreciated. Please vist our Contribution Guide for more details About Arch is an intelligent prompt gateway. Engineered with (fast) LLMs for the secure handling, robust observability, and seamless integration of prompts with APIs - all outside business logic. Built by the core contributors of Envoy proxy, on Envoy. archgw.com Topics proxy routing gateway prompt proxy-server openai llms generative-ai llmops llm-inference ai-gateway llm-gateway llm-routing Resources Readme License Apache-2.0 license Activity Custom properties Stars 176 stars Watchers 3 watching Forks 9 forks Report repository Releases No releases published Packages 0 No packages published Contributors 7 * @adilhafeez * @salmanap * @junr03 * @cotran2 * @aayushwhiz * @nehcgs * @Sampreeth-sarma Languages * Rust 74.6% * Python 21.3% * HTML 3.1% * Other 1.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.