k9x_studio
Visual Architecture Builder for K9-AIF Systems
k9x_studio is a browser-based drag-and-drop IDE for designing K9-AIF multi-agent systems. It reads the k9_aif_abb component library, lets architects compose systems visually on a canvas, and generates production-ready YAML configuration and Python scaffold — the same output as k9_generator.sh, but designed rather than typed.
Try it live: studio.k9x.ai
Installation
Recommended:
pip install k9x
Then start the studio:
k9x studio
This opens a browser tab at http://localhost:12999 by default. 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 satan # start K9X Satan, the adversarial red-team harness
k9x upgrade # pip install --upgrade k9x
Run k9x help for the full command list. See LLM Configuration
below for connecting a local or hosted model — the studio runs in demo mode
without one.
Workflow
1. Project Setup
└── Name, author, domain, description
2. Canvas Design (drag-and-drop)
├── Palette (left): Router, Orchestrator, Squad, Agent, ...
├── Canvas (center): drop nodes, draw connections
└── Inspector (right): configure selected node
3. Generate Architecture (LLM-powered when configured)
└── AI suggests Orchestrators, Squads, and Agents based on description
4. Export Scaffold
└── Downloads ZIP: config/ + agents/ + squads/ + Python stubs
OR writes directly to k9_projects/<AppName>/
LLM Configuration
LLM is optional but strongly recommended. Without it the studio works in demo mode — templates and manual canvas composition are fully functional, but the Generate Architecture button produces a generic fallback instead of an AI-tailored suggestion.
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
Recommended approach — run LLM locally
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:
localhostand127.0.0.1are 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.
Recommended models
| 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:
1. .env file — recommended for self-hosted deployments
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 (Docker / Podman -e flags)
podman run -d --name k9x_studio -p 8080:8080 \
-e LLM_PROVIDER=ollama \
-e LLM_ENDPOINT=http://10.0.0.5:11434 \
-e LLM_MODEL=granite3-dense:2b \
-e K9X_PROJECTS_ROOT="/k9x/projects" \
-v ~/k9x-studio-working:/k9x/projects:Z \
ghcr.io/k9aif/k9x-studio:latest
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 pull and run the container:
podman pull ghcr.io/k9aif/k9x-studio:latest
podman run -d --name k9x_studio -p 8080:8080 \
-e K9X_PROJECTS_ROOT="/k9x/projects" \
-v ~/k9x-studio-working:/k9x/projects:Z \
ghcr.io/k9aif/k9x-studio:latest
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
- K9-AIF Framework: github.com/k9aif/k9-aif-framework
- Studio container:
ghcr.io/k9aif/k9x-studio:latest - Live demo: studio.k9x.ai
- Ecosystem: k9x.ai/ecosystem
studiox
Metadata
Release files for k9x 0.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| k9x-0.4.5.tar.gz | 1.0 MB | Without provenance | Details for k9x-0.4.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| k9x-0.4.5-py3-none-any.whl | Python 3 | none | any | Details for k9x-0.4.5-py3-none-any.whl |
Total release size: 2.1 MB
Release files / k9x-0.4.5.tar.gz
| Download URL | k9x-0.4.5.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e03c52873aabd4cc7a72df82e4ba542056e25e74c5bbdcd3d182083de2ce1f2
|
|
BLAKE2b-256 checksum How to use checksums |
96e3b51e2aa469df4c0ee2b2e3bc9d7fdb5a0bf0b39e8cc862f9de810dbc9b73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Release files / k9x-0.4.5-py3-none-any.whl
| Download URL | k9x-0.4.5-py3-none-any.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b302eb18566e3c4203479ee2335b8157331d81a7ca618fdf9fa2dbda14603762
|
|
BLAKE2b-256 checksum How to use checksums |
91f28b47921278ef136a8e694a0cf2c3077e83c4b41f52a717473eb56315bb6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Security for k9x 0.4.5
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.