Skip to main content

arkitekt

Turn your Python functions into apps you can orchestrate, share, and scale.

codecov PyPI version PyPI pyversions Documentation


What is Arkitekt?

Arkitekt is an open platform for building, connecting, and orchestrating computational apps. arkitekt is its Python client: it takes your ordinary Python functions and exposes them as remotely callable, orchestratable building blocks — without you having to write servers, APIs, message queues, or UIs.

Declare an app, run it, and its actions become available on an Arkitekt server where they can be:

  • Called from anywhere — other apps, notebooks, scripts, or the web UI.
  • Composed into real-time workflows that wire your functions together.
  • Given a GUI automatically, generated from your Python type hints.
  • Shared with your team behind central authentication and permissions.
  • Packaged and deployed as a Docker container with a single command.

Arkitekt grew out of the needs of data-intensive science (it has first-class clients for microscopy, electrophysiology and graph data), but the core is domain-agnostic — any Python workload fits.

📚 The best place to understand the platform and its concepts is the documentation at arkitekt.live.

Installation

pip install "arkitekt[all]"

This installs the arkitekt command line interface, the runtime and every service client. Prefer a lean install? The CLI and packaging tooling are always included — pick only the extras you need:

Extra Brings in
rekuest the distributed runtime run(app) needs to offer actions
mikro microscopy and imaging data
elektro electrophysiology data and simulations
kraph knowledge graphs and measurements
fluss workflows, and the engine that runs them
kabinet managing deployments of apps
unlok users, clients, hubs and redeem tokens (lok)
alpaka LLMs and chat
lovekit WebRTC streams and rooms
serve serving an app from a FastAPI application (arkitekt-fastapi)
qt Qt integration (arkitekt.qt)
tqdm a tqdm that reports progress to the running task
pip install "arkitekt[rekuest,mikro]"

Declaring, inspecting and packaging an app, and calling services with easy, need no runtime; offering actions with run(app) needs the rekuest extra. arkitekt requires Python 3.11+.

Offering actions

An App is a declaration: its identifier, its version, and the actions it offers. Any function decorated with @app.action becomes a callable building block on the platform. Its arguments and return value are inferred from the type hints, which also drive validation, documentation and the generated GUI. The first line of the docstring becomes the action's title, the rest its description.

from typing import Annotated

from arkitekt import App, Description, run

app = App("hello", "0.1.0")


@app.action
def greet(
    name: Annotated[str, Description("Who to greet")] = "world",
    times: Annotated[int, Description("How often to say it")] = 1,
) -> str:
    """Greet

    Says hello.
    """
    return " ".join([f"Hello {name}!"] * times)


if __name__ == "__main__":
    run(app)

Nothing connects when the App is declared. run(app) authenticates (opening your browser the first time), registers the actions and blocks until you stop it. The server is taken from $FAKTS_URL, or passed explicitly with run(app, url="localhost"); headless=True prints a device code instead of opening a browser.

Using a service inside an action

Actions that need a service client name it in services= and take it by annotation — arkitekt injects the client, just like the running Task:

from arkitekt import App, Task, run
from mikro import Mikro, mikro_service
from mikro.arkitekt.specs import Volume

app = App("inspect-volume", "0.1.0", services=[mikro_service])


@app.action
def describe(volume: Volume, mikro: Mikro, task: Task) -> str:
    """Describe Volume"""
    task.progress(50, "Reading")
    return f"{volume.data.shape}"


if __name__ == "__main__":
    run(app)

Beyond actions, an app can declare @app.model result types, @app.state that the platform publishes live, @app.startup/@app.shutdown hooks and @app.background tasks, and a typed app context (App(..., app_context=Setup) together with run(app, context=Setup(...))). The examples show one each.

Workflows: actions that call other apps

Only a workflow may call other actions. Name what it needs of another app as a protocol with @app.declare, and take it by annotation; the platform resolves it to a running agent of that app:

from typing import AsyncGenerator, Protocol

from arkitekt import App, Task, run

app = App("shouter", "0.1.0")


@app.declare(app="testo", auto_resolvable=True, min=1)
class Testo(Protocol):
    async def stream_words(self, text: str) -> AsyncGenerator[str, None]:
        """Stream Words"""
        ...


@app.workflow
async def shout_words(testo: Testo, text: str, *, task: Task) -> AsyncGenerator[str, None]:
    """Shout Words"""
    async for word in testo.stream_words(text=text):  # streams every yield
        yield word.upper()


if __name__ == "__main__":
    run(app)

A workflow is called like any action, and it is the one kind of action that survives its agent dying: it is resumed, and the calls it already made return their recorded results rather than running again. A plain action whose agent dies ends LOST instead, and call raises AgentLost with what is known, for whoever called to decide. effects= on an action or an App says what running it again would do (Effects.NONE … Effects.IRREVERSIBLE), as information for that decision. Inside a workflow, task.retry, task.hold and task.guard cover the usual answers to a lost step: examples/recovery walks through them.

Calling services

Scripts and notebooks that only call the platform don't declare actions. easy declares an app for you, connects it, and hands back the clients of the services you name:

from arkitekt import easy
from mikro import mikro_service

with easy("my-script", mikro_service) as mikro:
    folder = mikro.create_folder(name="examples")

Name several services and you get a tuple back, in the same order:

from arkitekt import aeasy, interactive
from fluss import fluss_service
from mikro import mikro_service

async with aeasy("my-script", mikro_service, fluss_service) as (mikro, fluss):
    ...

# In Jupyter: connects once and stays connected.
mikro = interactive("notebook", mikro_service)

Every service client exposes each operation as a method, in a blocking and an a-prefixed async flavour (mikro.create_folder(...), await mikro.acreate_folder(...)).

Services on the deployment's mesh

Some deployments serve services only over their private mesh. With pip install "arkitekt[mesh]" those services resolve like any other: the login asks the server for a key to join the mesh with, and a mesh node starts only when a service is reachable no other way. Whether a key comes is up to the server — you can opt out of the mesh there, and an organization without one grants none; mesh-only services are then simply not reachable.

ARKITEKT_MESH=0 python my_app.py                                 # never use the mesh
ARKITEKT_MESH=1 python my_app.py                                 # use it, and report what is missing
ARKITEKT_MESH_PROXY=http://localhost:1055 python my_app.py       # go through a running `arkitekt mesh proxy`

The same in code, which wins over the environment: run(app, mesh=False), mesh=True (or MeshOptions(...)), or easy("my-script", mikro_service, mesh=MeshProxy(url=...)).

The CLI

arkitekt is the command line for building, running and packaging apps. Standing up an Arkitekt server is the job of konstruktor.

Command What it does
init Scaffold an app: an entrypoint file that declares it. There is no separate manifest.
run dev · run prod Run the app — with hot reloading while you develop, or as it runs in a container.
gen Generate typed clients.
inspect Show what the app would register, without connecting.
call Call an action of the app.
plugin Containerize the app into flavours and publish it as a deployable plugin.
mesh Join this machine to the deployment's private WireGuard mesh.
self Manage your install — upgrade the SDK, print versions, dump diagnostics.
mkdir my-app && cd my-app
arkitekt init          # scaffold an app
arkitekt run dev       # run it with hot reloading

See the full reference in docs/cli.md, and docs/app_types.md for choosing between a standalone and a plugin app.

Working with data

Arkitekt serializes and documents standard Python types — str, bool, int, float, Enum, list, dict, and pydantic models or dataclasses declared with @app.model. For heavier data (images, arrays, large objects), the platform follows a store-by-reference model: data lives in a central, scalable store and only a lightweight reference travels between apps. Service clients like mikro and elektro provide ready-made structures for this; within one app, app.memory_structure(...) lets arbitrary objects cross actions without leaving the agent.

Examples

examples/ holds small, self-contained scripts — one per thing an app can do. Each declares its dependencies in a PEP 723 header, so there is nothing to install:

uv run --script examples/hello.py

License

arkitekt is released under the MIT License.

Metadata

Release files for arkitekt 5.0.0

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

Source distribution (sdist)

Source distribution for arkitekt 5.0.0
File Size Uploaded
arkitekt-5.0.0.tar.gz 527.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arkitekt 5.0.0
File Interpreter ABI Platform
arkitekt-5.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / arkitekt-5.0.0.tar.gz

Download URL arkitekt-5.0.0.tar.gz
Size 527.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b30aa3cef2c054a1caed483e043e97f042bf68b46576f1b59012e86a742955e9
BLAKE2b-256 checksum
How to use checksums
646519614d66fadd50b34ae25b01f6b5cac3559eb49c6175d184a0b26175f35e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / arkitekt-5.0.0-py3-none-any.whl

Download URL arkitekt-5.0.0-py3-none-any.whl
Size 565.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf6ccc949a9e874c1cbc56943243821445ef34ee3bcebc5d7f151cffc98bc210
BLAKE2b-256 checksum
How to use checksums
b37afcd8106e9b1f5267e4428c164fb91046c27cf55462aa0a795439aa01bbc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

7.0.0

2 release files

6.8.0

2 release files

6.7.1

2 release files

6.7.0

2 release files

6.6.2

2 release files

6.6.1

2 release files

6.6.0

2 release files

6.5.0

2 release files

6.4.0

2 release files

6.3.0

2 release files

6.2.1

2 release files

6.2.0

2 release files

6.1.0

2 release files

6.0.0

2 release files

5.0.1

2 release files

This release

5.0.0 This release

2 release files

4.3.0

2 release files

4.2.1

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.59

2 release files

0.5.58

2 release files

0.5.57

2 release files

0.5.56

2 release files

0.5.55

2 release files

0.5.52

2 release files

0.5.51

1 release file

0.5.50

2 release files

0.5.49

2 release files

0.5.46

2 release files

0.5.45

2 release files

0.5.44

2 release files

0.5.43

2 release files

0.5.42

2 release files

0.5.41

2 release files

0.5.40

2 release files

0.5.39

2 release files

0.5.38

2 release files

0.5.36

2 release files

0.5.35

2 release files

0.5.34

2 release files

0.5.33

2 release files

0.5.32

2 release files

0.5.31

2 release files

0.5.30

2 release files

0.5.29

2 release files

0.5.28

2 release files

0.5.27

2 release files

0.5.26

2 release files

0.5.25

2 release files

0.5.24

2 release files

0.5.23

2 release files

0.5.22

2 release files

0.5.21

2 release files

0.5.20

2 release files

0.5.19

2 release files

0.5.18

2 release files

0.5.17

2 release files

0.5.16

2 release files

0.5.15

2 release files

0.5.14

2 release files

0.5.13

2 release files

0.5.12

2 release files

0.5.11

2 release files

0.5.10

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.97

2 release files

0.4.96

2 release files

0.4.95

2 release files

0.4.94

2 release files

0.4.93

2 release files

0.4.92

2 release files

0.4.91

2 release files

0.4.90

2 release files

0.4.89

2 release files

0.4.88

2 release files

0.4.87

2 release files

0.4.86

2 release files

0.4.85

2 release files

0.4.84

2 release files

0.4.83

2 release files

0.4.82

2 release files

0.4.81

2 release files

0.4.80

2 release files

0.4.79

2 release files

0.4.78

2 release files

0.4.77

2 release files

0.4.76

2 release files

0.4.75

2 release files

0.4.74

2 release files

0.4.73

2 release files

0.4.72

2 release files

0.4.71

2 release files

0.4.70

2 release files

0.4.69

2 release files

0.4.68

2 release files

0.4.66

2 release files

0.4.65

2 release files

0.4.64

2 release files

0.4.63

2 release files

0.4.62

2 release files

0.4.61

2 release files

0.4.60

2 release files

0.4.59

2 release files

0.4.58

2 release files

0.4.57

2 release files

0.4.56

2 release files

0.4.41

2 release files

0.4.40

2 release files

0.4.39

2 release files

0.4.38

2 release files

0.4.37

2 release files

0.4.36

2 release files

0.4.34

2 release files

0.4.33

2 release files

0.4.32

2 release files

0.4.31

2 release files

0.4.30

2 release files

0.4.29

2 release files

0.4.28

2 release files

0.4.27

2 release files

0.4.26

2 release files

0.4.25

2 release files

0.4.24

2 release files

0.4.23

2 release files

0.4.22

2 release files

0.4.21

2 release files

0.4.20

2 release files

0.4.19

2 release files

0.4.18

2 release files

0.4.17

2 release files

0.4.16

2 release files

0.4.15

2 release files

0.4.14

2 release files

0.4.13

2 release files

0.4.12

2 release files

0.4.11

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.1.99

2 release files

0.1.98

2 release files

0.1.97

2 release files

0.1.96

2 release files

0.1.95

2 release files

0.1.94

2 release files

0.1.93

2 release files

0.1.92

2 release files

0.1.81

2 release files

0.1.80

2 release files

0.1.79

2 release files

0.1.78

2 release files

0.1.77

2 release files

0.1.76

2 release files

0.1.75

2 release files

0.1.74

2 release files

0.1.73

2 release files

0.1.72

2 release files

0.1.71

2 release files

0.1.70

2 release files

0.1.69

2 release files

0.1.68

2 release files

0.1.67

2 release files

0.1.66

2 release files

0.1.65

2 release files

0.1.64

2 release files

0.1.63

2 release files

0.1.62

2 release files

0.1.61

2 release files

0.1.60

2 release files

0.1.59

2 release files

0.1.58

2 release files

0.1.57

2 release files

0.1.56

2 release files

0.1.55

2 release files

0.1.54

2 release files

0.1.53

2 release files

0.1.52

2 release files

0.1.51

2 release files

0.1.50

2 release files

0.1.49

2 release files

0.1.48

2 release files

0.1.47

2 release files

0.1.46

2 release files

0.1.45

2 release files

0.1.44

2 release files

0.1.43

2 release files

0.1.42

2 release files

0.1.41

2 release files

0.1.40

2 release files

0.1.39

2 release files

0.1.38

2 release files

0.1.37

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release 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