The Requesty adapter for LlamaIndex TypeScript provides a seamless integration to access over 300 large language models through the Requesty platform within your LlamaIndex applications.

Setup

# For pnpm
pnpm add @requesty/llamaindex

# For npm
npm install @requesty/llamaindex

# For yarn
yarn add @requesty/llamaindex

API Key Setup

For security, you should set your API key as an environment variable named exactly REQUESTY_API_KEY:
# Linux/Mac
export REQUESTY_API_KEY=your_api_key_here

# Windows Command Prompt
set REQUESTY_API_KEY=your_api_key_here

# Windows PowerShell
$env:REQUESTY_API_KEY="your_api_key_here"

Basic Usage

The adapter provides a simple interface to use Requesty models within your LlamaIndex TypeScript applications:
import { requesty } from "llamaindex-requesty";

const llm = requesty({
  model: "openai/gpt-4o-mini",
  apiKey: process.env.REQUESTY_API_KEY,
  baseURL: "https://your-requesty-endpoint.com/v1"
});

const response = await llm.chat({
  messages: [{ role: "user", content: "Hello!" }]
});

Supported Models

You can use any model available through Requesty. Find the complete list of available models at app.requesty.ai/models.

Features

300+ Models

Access models from OpenAI, Anthropic, Google, Mistral, and many other providers

Streaming Support

Full support for streaming responses for real-time applications

Structured Output

Support for structured output using Zod schemas

Tool Calling

Utilize function/tool calling capabilities with supported models

Multi-Agent Workflows

Support for complex multi-agent workflow configurations

Analytics & Telemetry

Powerful telemetry and analytics capabilities built-in

Getting Started

For detailed usage examples, configuration options, and advanced features, please refer to the GitHub repository which contains comprehensive documentation and examples to help you get started with the integration. The adapter is designed to work seamlessly with existing LlamaIndex TypeScript applications while providing access to Requesty’s powerful model routing and analytics capabilities.