Skip to main content

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

larkup-0.2.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

larkup-0.2.4-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file larkup-0.2.4.tar.gz.

File metadata

  • Download URL: larkup-0.2.4.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

Hashes for larkup-0.2.4.tar.gz
Algorithm Hash digest
SHA256 e19d7f884462fa3cd57f5dc53a2958e323bb317154c36dac5319fa6263f00dd4
MD5 799396ef33f8c7e3f8a6819d9478f1cf
BLAKE2b-256 5402fbc16c201569739cc79e876f307af1249105d357a921f8a6cdef19d9b077

See more details on using hashes here.

File details

Details for the file larkup-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: larkup-0.2.4-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

Hashes for larkup-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8cbaf898c4cfeb8cc880db0d814ffa1be997d65924eaf08385c8cee32edd481f
MD5 4465689b67d49aa715a53b6b894bb830
BLAKE2b-256 1234bd341a6d50dd859edffdcf16be99bc2039d58ebf7b6e6c73216d59765a78

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.5

2 files

This release

0.2.4 This release

2 files

0.2.3

2 files

0.1.74

2 files

0.1.72

2 files

0.1.71

2 files

0.1.70

2 files

0.1.69

2 files

0.1.68

2 files

0.1.67

2 files

0.1.64

2 files

0.1.62

2 files

0.1.61

2 files

0.1.50

2 files

0.1.49

2 files

0.1.43

2 files

0.1.42

2 files

0.1.41

2 files

0.1.40

2 files

0.1.39

2 files

0.1.38

2 files

0.1.37

2 files

0.1.36

2 files

0.1.35

2 files

0.1.32

2 files

0.1.30

2 files

0.1.29

2 files

0.1.20

2 files

0.1.19

2 files

0.1.14

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page