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 viapyfiglet).
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kontext_studio-0.261.0-py3-none-any.whl | Python 3 | none | any | Details for kontext_studio-0.261.0-py3-none-any.whl |
Release files / kontext_studio-0.261.0-py3-none-any.whl
| Download URL | kontext_studio-0.261.0-py3-none-any.whl |
|---|---|
| Size | 6.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aac5b32ff1b906834fc482e2ad0217fc0f07283ce6f14aedc370eb31ae033d05
|
|
BLAKE2b-256 checksum How to use checksums |
fba5bac021e4713da5054d6d2323745782898a13c0dedb4629cc0962eb3e0a9d
|
| 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 logSecurity for kontext-studio 0.261.0
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.0-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 logA 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.