Update doc (#178)

* Update doc

* Update links
This commit is contained in:
Shuguang Chen 2024-10-10 22:30:54 -07:00 committed by GitHub
parent 7b51cce2f7
commit 11fba23f1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 82 additions and 118 deletions

View file

@ -5,14 +5,14 @@ Agentic Workflow
Arch helps you easily personalize your applications by calling application-specific (API) functions Arch helps you easily personalize your applications by calling application-specific (API) functions
via user prompts. This involves any predefined functions or APIs you want to expose to users to perform tasks, via user prompts. This involves any predefined functions or APIs you want to expose to users to perform tasks,
gather information, or manipulate data. This capability is generally referred to as **function calling**, where gather information, or manipulate data. This capability is generally referred to as :ref:`function calling <function_calling>`, where
you have the flexibility to support “agentic” apps tailored to specific use cases - from updating insurance you have the flexibility to support “agentic” apps tailored to specific use cases - from updating insurance
claims to creating ad campaigns - via prompts. claims to creating ad campaigns - via prompts.
Arch analyzes prompts, extracts critical information from prompts, engages in lightweight conversation with Arch analyzes prompts, extracts critical information from prompts, engages in lightweight conversation with
the user to gather any missing parameters and makes API calls so that you can focus on writing business logic. the user to gather any missing parameters and makes API calls so that you can focus on writing business logic.
Arch does this via its purpose-built :ref:`Arch-Function <function_calling>` - the fastest (200ms p90 - 10x faser than GPT-4o) Arch does this via its purpose-built `Arch-Function <https://huggingface.co/collections/katanemo/arch-function-66f209a693ea8df14317ad68>`_ - the fastest (200ms p90 - 10x faser than GPT-4o)
and cheapest (100x than GPT-40) function-calling LLM that matches performance with frontier models. and cheapest (100x than GPT-4o) function calling LLM that matches performance with frontier models.
.. image:: includes/agent/function-calling-flow.jpg .. image:: includes/agent/function-calling-flow.jpg
:width: 100% :width: 100%
@ -31,7 +31,7 @@ Step 1: Define Prompt Targets
.. literalinclude:: includes/agent/function-calling-agent.yaml .. literalinclude:: includes/agent/function-calling-agent.yaml
:language: yaml :language: yaml
:linenos: :linenos:
:emphasize-lines: 21-34 :emphasize-lines: 19-49
:caption: Prompt Target Example Configuration :caption: Prompt Target Example Configuration
Step 2: Process Request Parameters Step 2: Process Request Parameters
@ -66,5 +66,5 @@ Example of Multiple Prompt Targets in YAML:
.. literalinclude:: includes/agent/function-calling-agent.yaml .. literalinclude:: includes/agent/function-calling-agent.yaml
:language: yaml :language: yaml
:linenos: :linenos:
:emphasize-lines: 21-34 :emphasize-lines: 19-49
:caption: Prompt Target Example Configuration :caption: Prompt Target Example Configuration

View file

@ -46,7 +46,7 @@ prompt_targets:
- name: time_range - name: time_range
type: int type: int
description: Time range in days for which to gather device statistics. Defaults to 7. description: Time range in days for which to gather device statistics. Defaults to 7.
default: "7" default: 7
# Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem. # Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem.
endpoints: endpoints:

View file

@ -9,7 +9,7 @@ Retrieval-Augmented Generation (RAG) applications.
Parameter Extraction for RAG Parameter Extraction for RAG
---------------------------- ----------------------------
To build RAG (Retrieval-Augmented Generation) applications, you can configure prompt targets with parameters, To build RAG (Retrieval Augmented Generation) applications, you can configure prompt targets with parameters,
enabling Arch to retrieve critical information in a structured way for processing. This approach improves the enabling Arch to retrieve critical information in a structured way for processing. This approach improves the
retrieval quality and speed of your application. By extracting parameters from the conversation, you can pull retrieval quality and speed of your application. By extracting parameters from the conversation, you can pull
the appropriate chunks from a vector database or SQL-like data store to enhance accuracy. With Arch, you can the appropriate chunks from a vector database or SQL-like data store to enhance accuracy. With Arch, you can
@ -37,12 +37,12 @@ Once the prompt targets are configured as above, handling those parameters is
----------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------
Developers struggle to efficiently handle ``follow-up`` or ``clarification`` questions. Specifically, when users ask for Developers struggle to efficiently handle ``follow-up`` or ``clarification`` questions. Specifically, when users ask for
changes or additions to previous responses their AI applications often generate entirely new responses instead of adjusting changes or additions to previous responses their AI applications often generate entirely new responses instead of adjusting
previous ones.Arch offers **intent** tracking as a feature so that developers can know when the user has shifted away from a previous ones. Arch offers ``intent tracking`` as a feature so that developers can know when the user has shifted away from a
previous intent so that they can dramatically improve retrieval accuracy, lower overall token cost and improve the speed of previous intent so that they can dramatically improve retrieval accuracy, lower overall token cost and improve the speed of
their responses back to users. their responses back to users.
Arch uses its built-in lightweight NLI and embedding models to know if the user has steered away from an active intent. Arch uses its built-in lightweight NLI and embedding models to know if the user has steered away from an active intent.
Arch's intent-drift detection mechanism is based on its' :ref:`prompt_targets <prompt_target>` primtive. Arch tries to match an incoming Arch's intent-drift detection mechanism is based on its :ref:`prompt target <prompt_target>` primtive. Arch tries to match an incoming
prompt to one of the prompt_targets configured in the gateway. Once it detects that the user has moved away from an active prompt to one of the prompt_targets configured in the gateway. Once it detects that the user has moved away from an active
active intent, Arch adds the ``x-arch-intent-marker`` headers to the request before sending it your application servers. active intent, Arch adds the ``x-arch-intent-marker`` headers to the request before sending it your application servers.
@ -50,15 +50,15 @@ active intent, Arch adds the ``x-arch-intent-marker`` headers to the request bef
:language: python :language: python
:linenos: :linenos:
:lines: 101-157 :lines: 101-157
:emphasize-lines: 14-24 :emphasize-lines: 14-25
:caption: Intent Detection Example :caption: Intent Detection Example
.. Note:: .. Note::
Arch is (mostly) stateless so that it can scale in an embarrassingly parrallel fashion. So, while Arch offers Arch is (mostly) stateless so that it can scale in an embarrassingly parrallel fashion. So, while Arch offers
intent-drift detetction, you still have to maintain converational state with intent drift as meta-data. The intent-drift detetction, you still have to maintain converational state with intent drift as metadata. The
following code snippets show how easily you can build and enrich conversational history with Langchain (in python), following code snippets show how easily you can build and enrich conversational history with Langchain (in Python),
so that you can use the most relevant prompts for your retrieval and for prompting upstream LLMs. so that you can use the most relevant prompts for your retrieval and for prompting upstream LLMs.

View file

@ -23,7 +23,7 @@ Below is an example of how you can configure ``llm_providers`` with an instance
.. Note:: .. Note::
When you start Arch, it creates a listener port for egress traffic based on the presence of ``llm_providers`` When you start Arch, it creates a listener port for egress traffic based on the presence of ``llm_providers``
configuration section in the ``arch_config.yml`` file. Arch binds itself to a local address such as configuration section in the ``arch_config.yml`` file. Arch binds itself to a local address such as
``127.0.0.1:51001/v1``. ``127.0.0.1:12000``.
Arch also offers vendor-agnostic SDKs and libraries to make LLM calls to API-based LLM providers (like OpenAI, Arch also offers vendor-agnostic SDKs and libraries to make LLM calls to API-based LLM providers (like OpenAI,
Anthropic, Mistral, Cohere, etc.) and supports calls to OSS LLMs that are hosted on your infrastructure. Arch Anthropic, Mistral, Cohere, etc.) and supports calls to OSS LLMs that are hosted on your infrastructure. Arch
@ -40,7 +40,7 @@ Example: Using the OpenAI Python SDK
from openai import OpenAI from openai import OpenAI
# Initialize the Arch client # Initialize the Arch client
client = OpenAI(base_url="http://127.0.0.1:51001/v1") client = OpenAI(base_url="http://127.0.0.12000/")
# Define your LLM provider and prompt # Define your LLM provider and prompt
llm_provider = "openai" llm_provider = "openai"

View file

@ -80,7 +80,7 @@ Here is a full list of parameter attributes that Arch can support:
Example Configuration Example Configuration
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python .. code-block:: yaml
prompt_targets: prompt_targets:
- name: get_weather - name: get_weather

View file

@ -16,8 +16,6 @@ Key Concepts
- **Error Message**: A clear, human-readable message describing the error. This should provide enough detail to inform users or developers of the root cause or required action. - **Error Message**: A clear, human-readable message describing the error. This should provide enough detail to inform users or developers of the root cause or required action.
- **Target Prompt**: The specific prompt or operation where the error occurred. Understanding where the error happened helps with debugging and pinpointing the source of the problem.
- **Parameter-Specific Errors**: Errors that arise due to invalid or missing parameters when invoking a function. These errors are critical for ensuring the correctness of inputs. - **Parameter-Specific Errors**: Errors that arise due to invalid or missing parameters when invoking a function. These errors are critical for ensuring the correctness of inputs.

View file

@ -27,7 +27,7 @@ containing two key-value pairs:
Prompt Guard Prompt Guard
----------------- -----------------
Arch is engineered with :ref:`Arch-Guard <prompt_guard>`, an industry leading safety layer, powered by a Arch is engineered with `Arch-Guard <https://huggingface.co/collections/katanemo/arch-guard-6702bdc08b889e4bce8f446d>`_, an industry leading safety layer, powered by a
compact and high-performimg LLM that monitors incoming prompts to detect and reject jailbreak attempts - compact and high-performimg LLM that monitors incoming prompts to detect and reject jailbreak attempts -
ensuring that unauthorized or harmful behaviors are intercepted early in the process. ensuring that unauthorized or harmful behaviors are intercepted early in the process.
@ -50,7 +50,7 @@ Prompt Targets
-------------- --------------
Once a prompt passes any configured guardrail checks, Arch processes the contents of the incoming conversation Once a prompt passes any configured guardrail checks, Arch processes the contents of the incoming conversation
and identifies where to forwad the conversation to via its ``prompt_targets`` primitve. Prompt targets are endpoints and identifies where to forwad the conversation to via its ``prompt target`` primitve. Prompt targets are endpoints
that receive prompts that are processed by Arch. For example, Arch enriches incoming prompts with metadata like knowing that receive prompts that are processed by Arch. For example, Arch enriches incoming prompts with metadata like knowing
when a user's intent has changed so that you can build faster, more accurate RAG apps. when a user's intent has changed so that you can build faster, more accurate RAG apps.
@ -67,48 +67,39 @@ Configuring ``prompt_targets`` is simple. See example below:
Check :ref:`Prompt Target <prompt_target>` for more details! Check :ref:`Prompt Target <prompt_target>` for more details!
Intent Detection and Prompt Matching: Intent Matching
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
Arch uses fast Natural Language Inference (NLI) and embedding approaches to first detect the intent of each Arch uses fast text embedding and intent recognition approaches to first detect the intent of each incoming prompt.
incoming prompt. This intent detection phase analyzes the prompt's content and matches it against predefined This intent matching phase analyzes the prompt's content and matches it against predefined prompt targets, ensuring that each prompt is forwarded to the most appropriate endpoint.
prompt targets, ensuring that each prompt is forwarded to the most appropriate endpoint. Archs intent Archs intent matching framework considers both the name and description of each prompt target, and uses a composite matching score between embedding similarity and intent classification scores to enchance accuracy in forwarding decisions.
detection framework considers both the name and description of each prompt target, and uses a composite matching
score between an NLI and cosine similarity to enchance accuracy in forwarding decisions.
- **Embeddings**: By embedding the prompt and comparing it to known target vectors, Arch effectively identifies - **Intent Recognition**: NLI techniques further refine the matching process by evaluating the semantic alignment between the prompt and potential targets.
the closest match, ensuring that the prompt is handled by the correct downstream service.
- **NLI**: NLI techniques further refine the matching process by evaluating the semantic alignment between the - **Text Embedding**: By embedding the prompt and comparing it to known target vectors, Arch effectively identifies the closest match, ensuring that the prompt is handled by the correct downstream service.
prompt and potential targets.
Agentic Apps via Prompt Targets Agentic Apps via Prompt Targets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To support agentic apps, like scheduling travel plans or sharing comments on a document - via prompts, Arch uses To support agentic apps, like scheduling travel plans or sharing comments on a document - via prompts, Arch uses its function calling abilities to extract critical information from the incoming prompt (or a set of prompts) needed by a downstream backend API or function call before calling it directly.
its function calling abilities to extract critical information from the incoming prompt (or a set of prompts) For more details on how you can build agentic applications using Arch, see our full guide :ref:`here <arch_agent_guide>`:
needed by a downstream backend API or function call before calling it directly. For more details on how you can
build agentic applications using Arch, see our full guide :ref:`here <arch_agent_guide>`:
.. Note:: .. Note::
Arch :ref:`Arch-Function <function_calling>` is the dedicated agentic model engineered in Arch to extract information from `Arch-Function <https://huggingface.co/collections/katanemo/arch-function-66f209a693ea8df14317ad68>`_ is a collection of dedicated agentic models engineered in Arch to extract information from a (set of) prompts and executes necessary backend API calls.
a (set of) prompts and executes necessary backend API calls. This allows for efficient handling of agentic tasks, This allows for efficient handling of agentic tasks, such as scheduling data retrieval, by dynamically interacting with backend services.
such as scheduling data retrieval, by dynamically interacting with backend services. Arch-Function is a flagship 1.3 Arch-Function achieves state-of-the-art performance, comparable with frontier models like Claude Sonnet 3.5 ang GPT-4, while being 100x cheaper ($0.05M/token hosted) and 10x faster (p50 latencies of 200ms).
billion parameter model that matches performance with frontier models like Claude Sonnet 3.5 ang GPT-4, while
being 100x cheaper ($0.05M/token hosted) and 10x faster (p50 latencies of 200ms).
Prompting LLMs Prompting LLMs
-------------- --------------
Arch is a single piece of software that is designed to manage both ingress and egress prompt traffic, drawing its Arch is a single piece of software that is designed to manage both ingress and egress prompt traffic, drawing its distributed proxy nature from the robust `Envoy <https://envoyproxy.io>`_.
distributed proxy nature from the robust `Envoy <https://envoyproxy.io>`_. This makes it extremely efficient and capable This makes it extremely efficient and capable of handling upstream connections to LLMs.
of handling upstream connections to LLMs. If your application is originating code to an API-based LLM, simply use If your application is originating code to an API-based LLM, simply use the OpenAI client and configure it with Arch.
the OpenAI client and configure it with Arch. By sending traffic through Arch, you can propagate traces, manage and monitor By sending traffic through Arch, you can propagate traces, manage and monitor traffic, apply rate limits, and utilize a large set of traffic management capabilities in a centralized way.
traffic, apply rate limits, and utilize a large set of traffic management capabilities in a centralized way.
.. Attention:: .. Attention::
When you start Arch, it automatically creates a listener port for egress calls to upstream LLMs. This is based on the When you start Arch, it automatically creates a listener port for egress calls to upstream LLMs. This is based on the
``llm_providers`` configuration section in the ``arch_config.yml`` file. Arch binds itself to a local address such as ``llm_providers`` configuration section in the ``arch_config.yml`` file. Arch binds itself to a local address such as
127.0.0.1:12000/v1. ``127.0.0.1:12000``.
Example: Using OpenAI Client with Arch as an Egress Gateway Example: Using OpenAI Client with Arch as an Egress Gateway
@ -119,7 +110,7 @@ Example: Using OpenAI Client with Arch as an Egress Gateway
import openai import openai
# Set the OpenAI API base URL to the Arch gateway endpoint # Set the OpenAI API base URL to the Arch gateway endpoint
openai.api_base = "http://127.0.0.1:12000/v1" openai.api_base = "http://127.0.0.1:12000"
# No need to set openai.api_key since it's configured in Arch's gateway # No need to set openai.api_key since it's configured in Arch's gateway
@ -132,5 +123,5 @@ Example: Using OpenAI Client with Arch as an Egress Gateway
print("OpenAI Response:", response.choices[0].text.strip()) print("OpenAI Response:", response.choices[0].text.strip())
In these examples, the OpenAI client is used to send traffic directly through the Arch egress proxy to the LLM of your choice, such as OpenAI. In these examples, the OpenAI client is used to send traffic directly through the Arch egress proxy to the LLM of your choice, such as OpenAI.
The OpenAI client is configured to route traffic via Arch by setting the proxy to ``127.0.0.1:51001``, assuming Arch is running locally and bound to that address and port. The OpenAI client is configured to route traffic via Arch by setting the proxy to ``127.0.0.1:12000``, assuming Arch is running locally and bound to that address and port.
This setup allows you to take advantage of Arch's advanced traffic management features while interacting with LLM APIs like OpenAI. This setup allows you to take advantage of Arch's advanced traffic management features while interacting with LLM APIs like OpenAI.

View file

@ -87,8 +87,6 @@ Today, only support a static bootstrap configuration file for simplicity today:
Request Flow (Ingress) Request Flow (Ingress)
---------------------- ----------------------
Overview
^^^^^^^^
A brief outline of the lifecycle of a request and response using the example configuration above: A brief outline of the lifecycle of a request and response using the example configuration above:
1. **TCP Connection Establishment**: 1. **TCP Connection Establishment**:
@ -105,7 +103,7 @@ A brief outline of the lifecycle of a request and response using the example con
intent matching via is **prompt-handler** subsystem using the name and description of the defined prompt targets, intent matching via is **prompt-handler** subsystem using the name and description of the defined prompt targets,
determining which endpoint should handle the prompt. determining which endpoint should handle the prompt.
4. **Parameter Gathering with Arch-FC**: 4. **Parameter Gathering with Arch-Function**:
If a prompt target requires specific parameters, Arch engages Arch-FC to extract the necessary details If a prompt target requires specific parameters, Arch engages Arch-FC to extract the necessary details
from the incoming prompt(s). This process gathers the critical information needed for downstream API calls. from the incoming prompt(s). This process gathers the critical information needed for downstream API calls.
@ -115,7 +113,7 @@ A brief outline of the lifecycle of a request and response using the example con
6. **Default Summarization by Upstream LLM**: 6. **Default Summarization by Upstream LLM**:
By default, if no specific endpoint processing is needed, the prompt is sent to an upstream LLM for summarization. By default, if no specific endpoint processing is needed, the prompt is sent to an upstream LLM for summarization.
This ensures that responses are concise and relevant, enhancing user experience in RAG (Retrieval-Augmented Generation) This ensures that responses are concise and relevant, enhancing user experience in RAG (Retrieval Augmented Generation)
and agentic applications. and agentic applications.
7. **Error Handling and Forwarding**: 7. **Error Handling and Forwarding**:
@ -134,11 +132,7 @@ A brief outline of the lifecycle of a request and response using the example con
Request Flow (Egress) Request Flow (Egress)
--------------------- ---------------------
Overview A brief outline of the lifecycle of a request and response in the context of egress traffic from an application to Large Language Models (LLMs) via Arch:
--------
A brief outline of the lifecycle of a request and response in the context of egress traffic from an application
to Large Language Models (LLMs) via Arch:
1. **HTTP Connection Establishment to LLM**: 1. **HTTP Connection Establishment to LLM**:
Arch initiates an HTTP connection to the upstream LLM service. This connection is handled by Archs egress listener Arch initiates an HTTP connection to the upstream LLM service. This connection is handled by Archs egress listener

View file

@ -29,7 +29,7 @@ networking operations (auth, tls, observability, etc) and the second process to
decisions on how to accept, handle and forward prompts. The second process is optional, as the model serving sevice could be decisions on how to accept, handle and forward prompts. The second process is optional, as the model serving sevice could be
hosted on a different network (an API call). But these two processes are considered a single instance of Arch. hosted on a different network (an API call). But these two processes are considered a single instance of Arch.
**Prompt Target**: Arch offers a primitive called :ref:`prompt_target <prompt_target>` to help separate business logic from undifferentiated **Prompt Target**: Arch offers a primitive called :ref:`prompt target <prompt_target>` to help separate business logic from undifferentiated
work in building generative AI apps. Prompt targets are endpoints that receive prompts that are processed by Arch. work in building generative AI apps. Prompt targets are endpoints that receive prompts that are processed by Arch.
For example, Arch enriches incoming prompts with metadata like knowing when a request is a follow-up or clarifying prompt For example, Arch enriches incoming prompts with metadata like knowing when a request is a follow-up or clarifying prompt
so that you can build faster, more accurate retrieval (RAG) apps. To support agentic apps, like scheduling travel plans or so that you can build faster, more accurate retrieval (RAG) apps. To support agentic apps, like scheduling travel plans or

View file

@ -3,13 +3,8 @@
Intro to Arch Intro to Arch
============= =============
Arch is an intelligent `(Layer 7) <https://www.cloudflare.com/learning/ddos/what-is-layer-7/>`_ gateway Arch is an intelligent `(Layer 7) <https://www.cloudflare.com/learning/ddos/what-is-layer-7/>`_ gateway designed for generative AI apps, AI agents, and AI copilots that work with prompts.
designed for generative AI apps, AI agents, and Co-pilots that work with prompts. Engineered with purpose-built Engineered with purpose-built large language models (LLMs), Arch handles all 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.
large language models (LLMs), Arch handles all the critical but undifferentiated tasks related to the handling and
processing of prompts, including detecting and rejecting `jailbreak <https://github.com/verazuo/jailbreak_llms>`_
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.
.. image:: /_static/img/arch-logo.png .. image:: /_static/img/arch-logo.png
:width: 100% :width: 100%
@ -21,70 +16,51 @@ in a centralized way.
including secure handling, intelligent routing, robust observability, and integration with backend (API) including secure handling, intelligent routing, robust observability, and integration with backend (API)
systems for personalization - all outside business logic.* systems for personalization - all outside business logic.*
In practice, achieving the above goal is incredibly difficult.
Arch attempts to do so by providing the following high level features:
In practice, achieving the above goal is incredibly difficult. Arch attempts to do so by providing the **Out-of-process architecture, built on** `Envoy <http://envoyproxy.io/>`_:
following high level features: Arch is takes a dependency on Envoy and is a self-contained process that is designed to run alongside your application servers.
Arch uses Envoy's HTTP connection management subsystem, HTTP L7 filtering and telemetry capabilities to extend the functionality exclusively for prompts and LLMs.
This gives Arch several advantages:
_____________________________________________________________________________________________________________ * Arch builds on Envoy's proven success. Envoy is used at masssive sacle by the leading technology companies of our time including `AirBnB <https://www.airbnb.com>`_, `Dropbox <https://www.dropbox.com>`_, `Google <https://www.google.com>`_, `Reddit <https://www.reddit.com>`_, `Stripe <https://www.stripe.com>`_, etc. Its battle tested and scales linearly with usage and enables developers to focus on what really matters: application features and business logic.
**Out-of-process architecture, built on** `Envoy <http://envoyproxy.io/>`_: Arch is takes a dependency on * Arch works with any application language. A single Arch deployment can act as gateway for AI applications written in Python, Java, C++, Go, Php, etc.
Envoy and is a self-contained process that is designed to run alongside your application servers. Arch uses
Envoy's HTTP connection management subsystem, HTTP L7 filtering and telemetry capabilities to extend the
functionality exclusively for prompts and LLMs. This gives Arch several advantages:
* Arch builds on Envoy's proven success. Envoy is used at masssive sacle by the leading technology companies of * Arch can be deployed and upgraded quickly across your infrastructure transparently without the horrid pain of deploying library upgrades in your applications.
our time including `AirBnB <https://www.airbnb.com>`_, `Dropbox <https://www.dropbox.com>`_,
`Google <https://www.google.com>`_, `Reddit <https://www.reddit.com>`_, `Stripe <https://www.stripe.com>`_,
etc. Its battle tested and scales linearly with usage and enables developers to focus on what really matters:
application features and business logic.
* Arch works with any application language. A single Arch deployment can act as gateway for AI applications **Engineered with Fast LLMs:** Arch is engineered with specialized tiny LLMs that are desgined for fast, cost-effective and acurrate handling of prompts.
written in Python, Java, C++, Go, Php, etc. These LLMs are designed to be best-in-class for critcal prompt-related tasks like:
* Arch can be deployed and upgraded quickly across your infrastructure transparently without the horrid pain * **Function Calling:** Arch helps you easily personalize your applications by enabling calls to application-specific (API) operations via user prompts.
of deploying library upgrades in your applications. This involves any predefined functions or APIs you want to expose to users to perform tasks, gather information, or manipulate data.
With function calling, you have flexibility to support "agentic" experiences tailored to specific use cases - from updating insurance claims to creating ad campaigns - via prompts.
Arch analyzes prompts, extracts critical information from prompts, engages in lightweight conversation to gather any missing parameters and makes API calls so that you can focus on writing business logic.
For more details, read :ref:`Function Calling <function_calling>`.
**Engineered with Fast LLMs:** Arch is engineered with specialized (sub-billion) LLMs that are desgined for * **Prompt Guard:** Arch helps you improve the safety of your application by applying prompt guardrails in a centralized way for better governance hygiene.
fast, cost-effective and acurrate handling of prompts. These LLMs are designed to be With prompt guardrails you can prevent ``jailbreak attempts`` present in user's prompts without having to write a single line of code.
best-in-class for critcal prompt-related tasks like: To learn more about how to configure guardrails available in Arch, read :ref:`Prompt Guard <prompt_guard>`.
* **Function/API Calling:** Arch helps you easily personalize your applications by enabling calls to * **[Coming Soon] Intent-Markers:** Developers struggle to handle ``follow-up`` or ``clarifying`` questions.
application-specific (API) operations via user prompts. This involves any predefined functions or APIs Specifically, when users ask for modifications or additions to previous responses their AI applications often generate entirely new responses instead of adjusting the previous ones.
you want to expose to users to perform tasks, gather information, or manipulate data. With function calling, Arch offers intent-markers as a feature so that developers know when the user has shifted away from the previous intent so that they can improve their retrieval, lower overall token cost and dramatically improve the speed and accuracy of their responses back to users.
you have flexibility to support "agentic" experiences tailored to specific use cases - from updating insurance For more details :ref:`intent markers <arch_rag_guide>`.
claims to creating ad campaigns - via prompts. Arch analyzes prompts, extracts critical information from
prompts, engages in lightweight conversation to gather any missing parameters and makes API calls so that you can
focus on writing business logic. For more details, read :ref:`prompt processing <arch_overview_prompt_handling>`.
* **Prompt Guardrails:** Arch helps you improve the safety of your application by applying prompt guardrails in **Traffic Management:** Arch offers several capabilities for LLM calls originating from your applications, including smart retries on errors from upstream LLMs, and automatic cutover to other LLMs configured in Arch for continuous availability and disaster recovery scenarios.
a centralized way for better governance hygiene. With prompt guardrails you can prevent `jailbreak <https://github.com/verazuo/jailbreak_llms>`_ Arch extends Envoy's `cluster subsystem <https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/cluster_manager>`_ to manage upstream connections to LLMs so that you can build resilient AI applications.
attempts or toxicity present in user's prompts without having to write a single line of code. To learn more
about how to configure guardrails available in Arch, read :ref:`prompt processing <arch_overview_prompt_handling>`.
* **[Coming Soon] Intent-Markers:** Developers struggle to handle `follow-up <https://www.reddit.com/r/ChatGPTPromptGenius/comments/17dzmpy/how_to_use_rag_with_conversation_history_for/?>`_, **Front/edge Gateway:** There is substantial benefit in using the same software at the edge (observability, traffic shaping alogirithms, applying guardrails, etc.) as for outbound LLM inference use cases.
or `clarifying <https://www.reddit.com/r/LocalLLaMA/comments/18mqwg6/best_practice_for_rag_with_followup_chat/>`_ Arch has the feature set that makes it exceptionally well suited as an edge gateway for AI applications.
questions. Specifically, when users ask for modifications or additions to previous responses their AI applications This includes TLS termination, applying guardrail early in the pricess, intelligent parameter gathering from prompts, and prompt-based routing to backend APIs.
often generate entirely new responses instead of adjusting the previous ones. Arch offers intent-markers as a
feature so that developers know when the user has shifted away from the previous intent so that they can improve
their retrieval, lower overall token cost and dramatically improve the speed and accuracy of their responses back
to users. For more details :ref:`intent markers<arch_rag_guide>`
**Traffic Management:** Arch offers several capabilities for LLM calls originating from your applications, including smart
retries on errors from upstream LLMs, and automatic cutover to other LLMs configured in Arch for continuous availability
and disaster recovery scenarios. Arch extends Envoy's `cluster subsystem <https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/cluster_manager>`_
to manage upstream connections to LLMs so that you can build resilient AI applications.
**Front/edge Gateway:** There is substantial benefit in using the same software at the edge (observability,
traffic shaping alogirithms, applying guardrails, etc.) as for outbound LLM inference use cases. Arch has the feature set
that makes it exceptionally well suited as an edge gateway for AI applications. This includes TLS termination, applying
guardrail early in the pricess, intelligent parameter gathering from prompts, and prompt-based routing to backend APIs.
**Best-In Class Monitoring:** Arch offers several monitoring metrics that help you understand three critical aspects of **Best-In Class Monitoring:** Arch offers several monitoring metrics that help you understand three critical aspects of
your application: latency, token usage, and error rates by an upstream LLM provider. Latency measures the speed at which your application: latency, token usage, and error rates by an upstream LLM provider. Latency measures the speed at which
your application is responding to users, which includes metrics like time to first token (TFT), time per output token (TOT) your application is responding to users, which includes metrics like time to first token (TFT), time per output token (TOT)
metrics, and the total latency as perceived by users. metrics, and the total latency as perceived by users.
**End-to-End Tracing:** Arch propagates trace context using the W3C Trace Context standard, specifically through the **End-to-End Tracing:** Arch propagates trace context using the W3C Trace Context standard, specifically through the ``traceparent`` header.
``traceparent`` header. This allows each component in the system to record its part of the request flow, enabling **end-to-end tracing** This allows each component in the system to record its part of the request flow, enabling end-to-end tracing across the entire application.
across the entire application. By using OpenTelemetry, Arch ensures that developers can capture this trace data consistently and By using OpenTelemetry, Arch ensures that developers can capture this trace data consistently and in a format compatible with various observability tools.
in a format compatible with various observability tools. For more details, read :ref:`tracing <arch_overview_tracing>`. For more details, read :ref:`Tracing <arch_overview_tracing>`.

View file

@ -16,7 +16,7 @@ Before you begin, ensure you have the following:
- ``Docker`` & ``Python`` installed on your system - ``Docker`` & ``Python`` installed on your system
- ``API Keys`` for LLM providers (if using external LLMs) - ``API Keys`` for LLM providers (if using external LLMs)
The fastest way to get started using Arch is to use `katanemo/arch <https://hub.docker.com/r/katanemo/arch>`_ pre-built binaries. The fastest way to get started using Arch is to use `katanemo/archgw <https://hub.docker.com/r/katanemo/archgw>`_ pre-built binaries.
You can also build it from source. You can also build it from source.

View file

@ -35,7 +35,7 @@ Function Calling Workflow
Arch-Function Arch-Function
------------------------- -------------------------
The `Arch-Function <https://huggingface.co/collections/katanemolabs/arch-function-66f209a693ea8df14317ad68>`_ collection of large language models (LLMs) is a collection state-of-the-art (SOTA) LLMs specifically designed for **function calling** tasks. The `Arch-Function <https://huggingface.co/collections/katanemo/arch-function-66f209a693ea8df14317ad68>`_ collection of large language models (LLMs) is a collection state-of-the-art (SOTA) LLMs specifically designed for **function calling** tasks.
The models are designed to understand complex function signatures, identify required parameters, and produce accurate function call outputs based on natural language prompts. The models are designed to understand complex function signatures, identify required parameters, and produce accurate function call outputs based on natural language prompts.
Achieving performance on par with GPT-4, these models set a new benchmark in the domain of function-oriented tasks, making them suitable for scenarios where automated API interaction and function execution is crucial. Achieving performance on par with GPT-4, these models set a new benchmark in the domain of function-oriented tasks, making them suitable for scenarios where automated API interaction and function execution is crucial.

View file

@ -39,7 +39,7 @@ Arch-Guard is designed to address this challenge.
What Is Arch-Guard What Is Arch-Guard
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
`Arch-Guard <https://huggingface.co/collections/katanemolabs/arch-guard-6702bdc08b889e4bce8f446d>`_ is a robust classifier model specifically trained on a diverse corpus of prompt attacks. `Arch-Guard <https://huggingface.co/collections/katanemo/arch-guard-6702bdc08b889e4bce8f446d>`_ is a robust classifier model specifically trained on a diverse corpus of prompt attacks.
It excels at detecting explicitly malicious prompts, providing an essential layer of security for LLM applications. It excels at detecting explicitly malicious prompts, providing an essential layer of security for LLM applications.
By embedding Arch-Guard within the Arch architecture, we empower developers to build robust, LLM-powered applications while prioritizing security and safety. With Arch-Guard, you can navigate the complexities of prompt management with confidence, knowing you have a reliable defense against malicious input. By embedding Arch-Guard within the Arch architecture, we empower developers to build robust, LLM-powered applications while prioritizing security and safety. With Arch-Guard, you can navigate the complexities of prompt management with confidence, knowing you have a reliable defense against malicious input.

View file

@ -23,6 +23,7 @@ Arch (built by the contributors of `Envoy <https://www.envoyproxy.io/>`_ ) was b
.. toctree:: .. toctree::
:caption: Get Started :caption: Get Started
:titlesonly: :titlesonly:
:maxdepth: 2
get_started/overview get_started/overview
get_started/intro_to_arch get_started/intro_to_arch
@ -33,6 +34,7 @@ Arch (built by the contributors of `Envoy <https://www.envoyproxy.io/>`_ ) was b
.. toctree:: .. toctree::
:caption: Concepts :caption: Concepts
:titlesonly: :titlesonly:
:maxdepth: 2
concepts/tech_overview/tech_overview concepts/tech_overview/tech_overview
concepts/llm_provider concepts/llm_provider
@ -43,6 +45,7 @@ Arch (built by the contributors of `Envoy <https://www.envoyproxy.io/>`_ ) was b
.. toctree:: .. toctree::
:caption: Guides :caption: Guides
:titlesonly: :titlesonly:
:maxdepth: 2
guides/prompt_guard guides/prompt_guard
guides/function_calling guides/function_calling
@ -53,6 +56,7 @@ Arch (built by the contributors of `Envoy <https://www.envoyproxy.io/>`_ ) was b
.. toctree:: .. toctree::
:caption: Build with Arch :caption: Build with Arch
:titlesonly: :titlesonly:
:maxdepth: 2
build_with_arch/agent build_with_arch/agent
build_with_arch/rag build_with_arch/rag
@ -62,5 +66,6 @@ Arch (built by the contributors of `Envoy <https://www.envoyproxy.io/>`_ ) was b
.. toctree:: .. toctree::
:caption: Resources :caption: Resources
:titlesonly: :titlesonly:
:maxdepth: 2
resources/configuration_reference resources/configuration_reference