Larkup Python SDK
The synchronous and asynchronous Python clients for a generated Larkup server.
Install
pip install larkup
Use
from larkup import LarkupClient, LarkupClientOptions
client = LarkupClient(
LarkupClientOptions(
base_url="http://localhost:8080",
api_key="your-api-key",
)
)
result = client.query("What is Larkup?", top_k=5)
for event in client.chat("Summarize the result."):
if event.type == "text-delta":
print(event.text or "", end="", flush=True)
The SDK supports health and OpenAPI discovery, retrieval, document CRUD, sequential or parallel bulk indexing with progress, corpus filtering and export, scraping, and streaming chat grounded in retrieved content. AsyncLarkupClient provides matching asynchronous methods.
Agent Server
In Settings → Runtime, select Agent and start the server. Then use its
displayed URL.
Open <displayed-url>/reference for the interactive Scalar API reference or
<displayed-url>/openapi.json for the OpenAPI document:
import os
from larkup import LarkupAgentClient
agent = LarkupAgentClient(
base_url="http://localhost:8080",
api_key=os.environ["LARKUP_API_KEY"],
)
print(agent.health())
for capability in agent.capabilities():
print(capability.name, capability.tools)
print(agent.configuration().systemPrompt)
print(agent.sandbox())
for text in agent.stream_text("Hello"):
print(text, end="", flush=True)
Select an available chat model
Generated runtimes expose their usable chat catalog through the SDK. Model selection is per request, so it does not mutate the deployment default.
from larkup import AgentChatRequest
catalog = agent.chat_model_catalog()
models = agent.chat_models("anthropic")
if models:
print(agent.chat_text(AgentChatRequest(
messages=[{"role": "user", "content": "Summarize the project."}],
provider=catalog.configuredProvider,
modelId=models[0].id,
)))
AI Gateway runtimes can select any language model returned by the catalog; direct-provider runtimes are limited to their configured provider. See the Vercel AI Gateway model catalog for current providers and models.
LarkupHubClient and AsyncLarkupHubClient provide typed Marketplace catalog discovery. Install and uninstall operations remain in the CLI because they change the local Larkup tool directory.
See the Python SDK documentation for the complete guide.
Development
cd apps/sdk/py-sdk
uv run pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file larkup-0.2.3.tar.gz.
File metadata
- Download URL: larkup-0.2.3.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f9c6067a205a34fcefec759d9f3f2a6529c9fdf6dcf23dae24e5f3ecd954dea
|
|
| MD5 |
ea3df5c88e575e905838ee6aae19d984
|
|
| BLAKE2b-256 |
28f2f9b59f48caf82fbfac6f3e83c020e74c6f5e8775b5cc3f80d71edbd55069
|
File details
Details for the file larkup-0.2.3-py3-none-any.whl.
File metadata
- Download URL: larkup-0.2.3-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fd5fdb78ef06b6fe1346c24d744b79cb109005442dce0ec8bbb2cb9491a2856
|
|
| MD5 |
7b01e8687d708fa3a83afeebf8c9cb60
|
|
| BLAKE2b-256 |
44db0e1e6c9085c7eab240aaf1b2c23cd8e3f47b0fb7c378b0cb2d49c4e7d06d
|