1.0.6 • Published 6 months ago

@apiary-gateway/cli v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Installing Apiary with the Apiary CLI

Introduction

Apiary is a large language model (LLM) gateway for handling requests to multiple LLM providers with a unified API. It provides built-in observability, cost tracking, fallbacks, request routing, simple and semantic caching, and output guardrails.

The Apiary CLI tool facilitates easy deployment of its AWS infrastructure. Once deployed, you can start making LLM requests using the Apiary SDK.

Infrastructure Overview

Apiary deploys and provisions the following key components in your AWS account:

Getting Started

Prerequisites

To get started with Apiary, ensure that you have the following set up:

  • An active AWS account with a user or role that has the AdministratorAccess policy attached. This user or role must be configured for use with the AWS CLI.
  • AWS CLI is installed and configured
  • AWS CDK is installed
  • AWS Bedrock is configured in your account to allow access to the Titan Text Embeddings V2 model
    • Bedrock access must be configured through the Bedrock console. Follow these steps to grant access to the Titan Text Embeddings V2 model.
  • Node.js and npm are installed

Installation

To install the Apiary CLI tool, run the following command:

npm install -g @apiary-gateway/cli

To verify that the installation was successful, run:

apiary --version

This will output the installed version number.

To view a list of available commands, run:

apiary --help

First Time Usage

Running apiary create will clone the Apiary CDK infrastructure into a new apiary folder inside your current working directory. Make sure you're in the directory where you want the apiary folder to be created before running the command.

Upon running apiary create, you'll be prompted to provide your LLM provider API keys as part of the deployment process. These will be securely stored using AWS Secrets Manager.

Once deployed, the Apiary CLI will output:

  • An AiGatewayRestApiEndpoint URL - you can start sending LLM requests to this URL using the Apiary SDK
  • An API key to use when sending requests to your Apiary instance. Please save this key securely for future reference
    • You can manage API keys and usage plans for your Apiary instance using the commands below
  • A FrontendBucketUrl URL - visit this URL to access the Observability and Management Dashboard. Use the dashboard to:
    • Set custom routing rules for your Apiary instance
    • Configure caching and guardrails settings
    • Monitor requests and LLM responses flowing through the system

Commands

apiary create

Deploy Apiary infrastructure to AWS.

apiary destroy

Delete all Apiary resources in your AWS account. This action is irreversible.

apiary update-llm-api-keys

Update your stored API keys for LLM providers.

apiary delete-llm-api-keys

Delete all of your stored API keys for LLM providers. This action is irreversible.

apiary create-usage-plan-with-key

Create a new usage plan for your Apiary instance with an associated API key.

apiary get-usage-plans

View all usage plans associated with your Apiary instance.

apiary delete-usage-plan

Delete a specific usage plan associated with your Apiary instance. This will also delete the API key(s) associated with the usage plan. You'll be prompted to provide the usage plan ID.

apiary edit-usage-plan

Edit a specific usage plan associated with your Apiary instance. You'll be prompted to provide the usage plan ID.

apiary help [COMMAND]

Display usage and description for an Apiary command.

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago