Skip to main content

K9X Studio

From process to governed multi-agent code.

K9X Studio turns the process you already have (a BPMN diagram, a process specification, an agent evaluation plan) into a governed K9-AIF architecture and a runnable scaffold. It maps every process step onto the Router → Orchestrator → Squad → Agent hierarchy, lets you review that mapping in a traceability matrix and reshape it on a visual canvas, then generates the project with k9x_Shield, Zero Trust and human-in-the-loop hooks already wired in.

Try it live: studio.k9x.ai


Installation

pip install k9x
k9x studio

This opens a browser tab at http://localhost:12999 (sign in with demo / demo). Useful flags:

k9x studio --port 8080          # use a different port
k9x studio --bg                 # run in the background, return immediately
k9x studio --stop               # stop a background instance
k9x config                      # write a starter .env with LLM provider settings
k9x upgrade                     # pip install --upgrade k9x

Run k9x help for the full command list.


What you can import

Input Formats What it drives
BPMN diagram .bpmn, .xml, .zip from any BPMN 2.0 tool (Camunda, Bizagi, Blueworks Live, IBM Process Studio, …) Lanes become Orchestrators and Squads, tasks become Agents or Adapters
Process specification .md, .txt, .html spec or blueprint Agents, tools, observability and behavioral rules; joins with the BPMN when both are staged
Agent evaluation plan .md with Functional / Behavioral / Adversarial … eval sections One tests/evals/*.py stub per test case, plus framework coverage on the Evals tab

Any one input is enough; together they give the richest result.

IBM Process Studio. Process Studio's BPMN, blueprint and Agent Evaluation Plan exports work in the tiles above, including its GREEN / AMBER / RED autonomy-zone colouring. An Enterprise App Kit (.zip) import is shown in its own collapsible IBM Process Studio group on the Intake tab and is marked coming soon.


Workflow

1. Intake          Upload BPMN / spec / eval plan → pre-checks → Granite Guardian screen → Generate
2. Traceability    Review and edit the Process → Implementation matrix → Confirm & Build Canvas
3. Canvas          Rearrange Routers, Orchestrators, Squads, Agents, Adapters
4. Generate        Generate Scaffold → download a ZIP, or browse it on the View Scaffold tab

The Evals and Traceability tabs are always present and stay empty until an input that feeds them is staged. You can also start from a template or compose the canvas by hand.


Granite Guardian screening

Every file staged on the Intake tab is pre-checked and then screened by a Granite Guardian model before Studio uses it. Screening is on by default; turn it off in .env:

GUARDIAN_ENABLED=true                         # set to false to skip the Guardian screen
GOVERNANCE_LLM_ENDPOINT=http://127.0.0.1:11434
GOVERNANCE_LLM_MODEL=granite4.1-guardian:8b   # ollama pull granite4.1-guardian:8b

With screening on and no reachable Guardian model, uploads are blocked (the header shows Guardian Offline). With it off, the header shows Guardian Off and uploads skip the screen.


LLM Configuration

An LLM is optional. BPMN, spec and eval-plan import are rule-based and work without one. An LLM adds smarter squad grouping for unstructured specs, AI-suggested architectures from a free-text description, and optional narrated documentation.

Why configure an LLM?

  • Generate Architecture uses the LLM to suggest Orchestrators, Squads, and Agents suited to your project description
  • BPMN import (complex diagrams) uses the LLM to intelligently group flat tasks into meaningful Squads

Install Ollama on your own machine or server and pull a model:

ollama pull granite3-dense:2b   # fast, good JSON output
# or
ollama pull llama3.1:8b         # higher quality suggestions

Then point the studio at your Ollama endpoint. Your data never leaves your environment.

Supported providers

Provider Endpoint example Notes
Ollama http://10.0.0.5:11434 Local / self-hosted. No API key needed.
OpenAI-compatible https://api.openai.com/v1 Also works with vLLM, LM Studio, Together AI
Anthropic https://api.anthropic.com Requires Anthropic API key

Note: localhost and 127.0.0.1 are intentionally blocked on the hosted instance at studio.k9x.ai to prevent the server's own resources from being used. Always use an IP address or hostname when configuring the endpoint.

Use case Model
Local / fast granite3-dense:2b, mistral:7b
Local / quality llama3.1:8b, llama3.2:3b
OpenAI gpt-4o-mini (best price/quality for JSON tasks)
Anthropic claude-haiku-4-5-20251001 (fast), claude-sonnet-4-6 (quality)

Configuration methods

The studio checks LLM config in this priority order:

Copy .env.sample to .env and fill in your values:

cp .env.sample .env
# .env
LLM_PROVIDER=ollama
LLM_ENDPOINT=http://10.0.0.5:11434
LLM_MODEL=granite3-dense:2b
LLM_API_KEY=                        # leave blank for Ollama

The .env file is loaded automatically on startup and is excluded from source control.

2. Environment variables (--env-file on podman run, used by ubuntu/build-run.sh)

ubuntu/build-run.sh start passes this project's own .env straight through via --env-file — see method 1 above; there's no separate -e flag list to maintain.

3. config.yaml (file-based, alternative to .env)

Edit config.yaml in the studio root before starting:

llm:
  enabled: true
  provider: ollama
  endpoint: "http://10.0.0.5:11434"
  model: granite3-dense:2b
  api_key: ""

4. Browser UI (session-only, transient)

Click ⬡ LLM Config at the bottom of the left panel. Enter endpoint, model, and optional API key. Config is held in your browser session only — it is not stored and clears on page refresh. Ideal for one-off use on a shared or public instance.


Running locally

cd k9x_studio

# 1. Configure your environment (first time only)
cp .env.sample .env
# Edit .env — add your LLM endpoint, API keys, and any other external config

# 2. Start
./run.sh          # starts backend (port 8080) + frontend dev server (port 5173)

.env is gitignored and never committed. All secrets stay local to your machine.

Or build and run the container (Podman required, no separately-published image — see ubuntu/build-run.sh):

./ubuntu/build-run.sh all

Open http://localhost:8081.


Architecture

┌──────────┐    ┌────────────────────────────────────────────┐    ┌────────────────┐
│          │    │                  CANVAS                     │    │   INSPECTOR    │
│ PALETTE  │    │                                             │    │                │
│          │    │  [Router]────►[Orchestrator]                │    │ Node: Agent    │
│ Router   │    │                    │                        │    │ Name: FraudDet │
│ Orch.    │    │              [ClaimsSquad]                  │    │ Model: reason  │
│ Squad    │    │              ┌─────┴──────┐                 │    │ Pattern: loop  │
│ Agent    │    │          [Triage]  [Fraud] [Audit]          │    │ Role: ...      │
│ ValLoop  │    │                                             │    │                │
│ CritAct  │    │                                             │    │                │
│ Guard    │    │                                             │    │                │
└──────────┘    └────────────────────────────────────────────┘    └────────────────┘

Component Palette → ABB Mapping

Palette Node K9-AIF ABB Output
Router K9EventRouter router/ Python + config
Orchestrator BaseOrchestrator orchestrators/ Python + config
Squad BaseSquad squads/yaml/<name>.yaml
Agent BaseAgent agents/yaml/<name>.yaml + agents/src/<name>.py
Validation Loop K9ValidationLoopAgent Agent with iterative loop scaffold
Critic-Actor K9CriticActorAgent Agent with actor/critic scaffold
Guard BaseGovernance Governance config entry

Tech Stack

Layer Technology
Frontend canvas React + React Flow
Frontend UI TypeScript + CSS
Backend API Python FastAPI
Scaffold generation Jinja2 templates
Export ZIP download or write to k9_projects/

References

Metadata

Release files for k9x 0.5.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 k9x 0.5.0
File Size Uploaded Provenance Actions
k9x-0.5.0.tar.gz 1.6 MB Without provenance Details for k9x-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.2 MB

Release files / k9x-0.5.0.tar.gz

Download URL k9x-0.5.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
398a9e2fe92dd7690b1f4a5faf839c2b9b156dec83f45d736701fd229f3a6aaa
BLAKE2b-256 checksum
How to use checksums
91ce379d643c649f59b1a11f43ba621a9fc0056e6b0c1f3404b7201338bf25fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / k9x-0.5.0-py3-none-any.whl

Download URL k9x-0.5.0-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c6e6cfdf07c007a3cdebb1ba96c8e529f7751f277ba99d211a0b30d29be58d92
BLAKE2b-256 checksum
How to use checksums
9230de1361a9d874b284847356d7a2a3120a9fc086306b54eb3c3c4d6e652405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Security for k9x 0.5.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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