Skip to main content

Kontext (local runtime)

Local server and CLI composition root for Kontext. It is the end-user entry point: kontext-studio starts the local API server, serves the built React app, and runs an embedded local job worker.

Features

  • Local server: hosts the React app and exposes the same API contract as the cloud deployment.
  • Local-first runtime: SQLite plus the local filesystem, with in-process execution. No external database or object store required.
  • CLI subcommands: manage projects, import data, run jobs, and execute SQL without starting the full server.
  • Rich UI: terminal banners and tables via rich (ASCII art via pyfiglet).

Installation

This package is installed as part of the unified kontext-studio wheel. See the repository README for the end-user install path.

For local development, sync the whole uv workspace from the repository root:

uv sync

pyfiglet, rich, and python-dotenv are regular dependencies of this package.

Usage

# Start the local server and web app (default command)
kontext

# Same, via the explicit serve entry point
kontext serve

# Manage projects, import data, run jobs, and query
kontext project list
kontext project create --name "My project"
kontext project import --project <id> ./data
kontext job list
kontext job run <job> --project <id>
kontext query "select * from my_table limit 10" --project <id>

Run kontext --help or kontext <subcommand> --help for flags.

At startup the server prints the URL to open, including a per-run launch token in the fragment (http://127.0.0.1:8000/#token=...). Open that URL rather than the bare host: the API only issues credentials to callers presenting the token. The app removes the token from the address bar after reading it, and keeps the session in an HttpOnly cookie so file previews and new tabs work. The latest token is in ~/.kontext/runtime/launch.token; a per-port copy lives in launch-<port>.token when several servers run.

Architecture

src/kontext/labs/
├── cli.py          # argparse entry points (kontext)
├── server.py       # FastAPI app: serves the UI and the local API surface
├── local_worker.py # Embedded local job worker
├── async_cleanup.py
├── telemetry.py
└── _app_dist/      # Built React app synced in at package time

The kontext console script points at kontext.labs.cli. Local routers reuse the standard routers from kontext-api; keep local routes compatible with that contract rather than inventing separate local shapes.

Development

# Run the whole local stack (API + app) from the repository root
pnpm run dev:local

# Package tests
uv run --package kontext-studio pytest py/kontext-labs/tests

License

MIT. See the repository LICENSE.

Metadata

Release files for kontext-studio 0.261.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for kontext-studio 0.261.1
File Interpreter ABI Platform Actions
kontext_studio-0.261.1-py3-none-any.whl Python 3 none any Details for kontext_studio-0.261.1-py3-none-any.whl

Release files / kontext_studio-0.261.1-py3-none-any.whl

Download URL kontext_studio-0.261.1-py3-none-any.whl
Size 6.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6baf8e0be738faabcdefd0ada2dd76dfd2e496844b5ca1b73d582f79ec4d7eb0
BLAKE2b-256 checksum
How to use checksums
0f410c6eaf69c590c5ae5847572da89a35314009225c10d950382cbec5b0de2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for kontext-studio 0.261.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for kontext_studio-0.261.1-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.261.1 This release

1 release file Full provenance

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