Skip to main content

Installation

The SDK is published to PyPI. Install it using pip or uv.

Initialization

Import the client and initialize it. The client will automatically fall back to LARKUP_API_URL and LARKUP_API_KEY environment variables if no arguments are passed. Both synchronous and asynchronous clients are available.

Basic Usage

Adding a Document

add_document() embeds and stores the document immediately. No second index call is required.

Bulk Indexing with Progress

Use mode="sequential" for strict request ordering or embedding providers with strict rate limits. Parallel mode controls client request scheduling only. The server retains its configured index type, vector store, embedding model, and chunking strategy.

Querying

Streaming Chat

The asynchronous client provides matching chat() and chat_text() methods:
The asynchronous client also exposes index_documents() as an async iterator.

Agent Server

Use LarkupAgentClient when the Larkup Server toggle is set to Agent. It lists loaded tools and consumes the Agent’s AI SDK UI-message stream.
Use capabilities() to inspect grouped integrations—selected built-ins, skills, sandbox, one entry per MCP connection, and plugins. A capability marked configured is selected in the Project but is not executable by this runtime; active entries are loaded. tools() remains available when you need the raw tool list. configuration() returns the UI prompt, selected tools, skills, and sandbox configuration; sandbox() checks readiness without exposing credentials. chat_text() collects through the streaming path, so slow tool calls do not hit the buffered-response timeout. Agent clients use a 120-second timeout by default; pass timeout= to adjust it. chat() exposes the raw HTTP response.

Choose a chat model

Every generated runtime exposes GET /models. Inspect its available choices through the SDK, then use modelId for one request without changing the deployment default.
An AI Gateway runtime can select any language model listed by its catalog. A runtime configured with a direct provider accepts only that provider’s model IDs, so its configured API key is never used with another vendor. Browse the current catalog and provider capabilities in the Vercel AI Gateway model catalog.

Corpus Inspection and Export

Media

Marketplace Hub

The matching AsyncLarkupHubClient supports asynchronous applications. Tool installation changes the Larkup host and therefore remains a CLI operation:

API Coverage

Local Demo

The repository includes a complete demo configured for http://localhost:8080:

Integrations

For connecting to LangChain Python, see the dedicated LangChain Integration guide.