Installation
The SDK is published to PyPI. Install it usingpip or uv.
Initialization
Import the client and initialize it. The client will automatically fall back toLARKUP_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
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
chat() and chat_text() methods:
index_documents() as an async iterator.
Agent Server
UseLarkupAgentClient when the Larkup Server toggle is set to Agent. It lists loaded
tools and consumes the Agent’s AI SDK UI-message stream.
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 exposesGET /models. Inspect its available choices
through the SDK, then use modelId for one request without changing the
deployment default.
Corpus Inspection and Export
Media
Marketplace Hub
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 forhttp://localhost:8080:

