Quickstart¶
In this tutorial you use a running Kionga stack to create a project, train a model with a real pipeline, deploy it to a live endpoint, request a prediction, and chat with an agent. Each step shows the console, and most also show the Python SDK and the REST API. All three call the same API, so you can mix them.
Before you begin¶
- Install and start Kionga: follow Install Kionga. The console must open at http://localhost:8080/console.html.
- To use the SDK tabs, open the Jupyter workbench from the console sidebar, create a notebook, and run the snippets in order. The SDK is installed there and already connected to your Kionga, so you do not need an API key.
-
To use the curl tabs, sign in once from a terminal and keep the session cookie:
export MLAIOPS_URL="${MLAIOPS_URL:-http://localhost:8080}" curl -fsS "$MLAIOPS_URL/api/v1/health" curl -fsS -o /dev/null -c kionga.cookies \ --data-urlencode username=admin --data-urlencode password=mlaiops-local \ "$MLAIOPS_URL/auth/local/login" curl -fsS -b kionga.cookies "$MLAIOPS_URL/api/v1/me"The health check returns
{"status":"ok",...}and needs no sign-in. The last command returns your identity. If the stack started on a different port, setMLAIOPS_URLto the console URL thatmake -C deploy local-upprinted.
Personal API keys
Scripts and tools that run outside Kionga authenticate with a personal API key
from Settings → Personal API keys, exported as MLAIOPS_TOKEN. A key acts
as a normal user, limited to the services and projects it names and to its
creator's provisioned access profile. The local admin account has no access
profile until an administrator provisions one, so its keys cannot create
projects. This tutorial uses the console session instead. See
Personal API keys.
Step 1: Sign in¶
Open http://localhost:8080/console.html and sign in with the local account
admin and password mlaiops-local.
The console opens on Overview.
Step 2: Create a project¶
A project owns everything you build in this tutorial.
- Open Projects and click + New project.
- Enter the name
churn. - Choose the Production ML system template, the
scikit-learnframework, and thecpuaccelerator. - Click Create project.
The project appears in Projects. The response includes its id, the pinned
template version, and a scaffold_command that generates starter code for the
project. To compare templates, see Project templates.
Step 3: Train a model with a pipeline¶
The built-in training pipeline validates a dataset, trains a scikit-learn model,
evaluates it, and registers it in your project as churn-classifier.
- Open Pipelines and click ▶ Run pipeline.
- Select the
churnproject and keep Built-in training pipeline as the flow. - Click Check run, then Start run.
- Open the run in the Runs table to follow each step.
The run moves through validate-data, train-model, evaluate, and
register-model, then reports succeeded. The trained model and its metrics are
also in MLflow at http://localhost:15000. If a step fails, open its log in the
run view to see the error.
Step 4: Deploy the model¶
- Open Models and find the
churn-classifiercard for your project. Its quality gate showspassed. - Click Promote to move it to the
productionstage. - Click Deploy.
curl -s -b kionga.cookies "$MLAIOPS_URL/api/v1/models"
curl -s -b kionga.cookies -X POST "$MLAIOPS_URL/api/v1/models/<model-id>/promote" \
-H 'Content-Type: application/json' -d '{"stage":"production"}'
curl -s -b kionga.cookies -X POST "$MLAIOPS_URL/api/v1/models/<model-id>/deploy" \
-H 'Content-Type: application/json' -d '{"canary_weight":0}'
Kionga starts a model server for this version. The model's deployment status
becomes serving and the card shows a live tag and a Test button.
Kionga deploys only models whose quality gate passed.
Step 5: Request a prediction¶
The model expects rows of 12 numeric features.
The response has this shape; the predicted class depends on the model:
The model server needs a short time to start after you deploy. If the first request fails, wait a few seconds and send it again.
Step 6: Chat with an agent¶
The local stack includes a customer-support agent built with LangGraph. Register it in your project, then talk to it.
- Open Agents and click + Deploy agent.
- Select the
churnproject and set the agent name tocustomer-support. - Keep the default image
mlaiops/agent-runtime:latest, graph moduleagents.customer_support.graph:build, and LLM backend Mock. - Click Deploy agent.
- When the agent shows as ready, click Chat and ask
When are invoices issued?.
The agent answers, and the Sessions table records the conversation with its
turns and token usage. The local stack uses the mock language model, so the
reply starts with [mock] and needs no provider key. To use a real provider,
see Using a real LLM.
One shared agent runtime
On the local stack, every agent runs on one shared runtime that serves
agents.customer_support.graph:build with the language model set by
MLAIOPS_LLM_BACKEND. Kionga records the image and backend you choose, but uses
them only on Kubernetes, where each agent gets its own runtime.
What you built¶
You created a project, trained and registered a model with a real pipeline, deployed it to a live endpoint, requested a prediction, and held a traced conversation with an agent. Every action is in the audit log, and the Overview page summarizes your work.
Next steps¶
- Build your own flows: Pipelines.
- Work in notebooks: Jupyter workbench.
- Serve your own models: Models and serving.
- Write your own agent: Agents.
- Explore online features and real-time scoring: Features and Real-time processing.
- Automate Kionga: Python SDK, REST API, and CLI.