ovat navigate

architecture

What each part does.
And how they connect.

OVAT sits between you and OpenVINO Model Server. OVMS does the inference. OVAT decides which model, which device, which parser and which tools, then runs the loop and the server for you. This page follows docs/ARCHITECTURE.md: a glossary first, then the principles, then each part in turn.

Glossary

The terms this page uses, in plain words.

Glossary of terms
TermMeaning
AgentA program where a language model can ask for your functions to be run, read the results, and then answer.
ToolOne of those functions, with a description the model reads. OVAT ships three for documents, audio and images (search_docs, transcribe, describe_image) and nine coding tools (read_file, write_file, edit, grep, shell, todo, ask_user, web_fetch, web_search).
Tool callThe model's request to run a tool: a name plus JSON arguments. The model only writes the request; OVAT runs the Python function.
EngineThe code that runs the agent loop. OVAT has four: its own native loop, LangChain (react), LlamaIndex and the OpenAI Agents SDK. You pick one with agent.type.
workflow.ymlThe one config file that describes an agent: model, device, tools, engine and prompt.
OpenVINOIntel's toolkit for running AI models fast on Intel CPUs, GPUs and NPUs.
OVMSOpenVINO Model Server. A separate program that loads a model and answers OpenAI-style HTTP requests on /v3. It decodes tool calls, so it is needed for agent runs.
openvino_genaiOpenVINO's Python library for running a model inside your own process, with no server. OVAT uses it for ovat chat, embeddings, Whisper and vision.
ExportA model already converted to OpenVINO's format, for example Qwen3.5-4B-int4-ov.
MCPModel Context Protocol, a standard way to offer tools to an agent. OVAT can use any MCP server as a tool, and its own tools also run as MCP servers.
RAGRetrieval-augmented generation: search your documents first, then give the matching passages to the model so it answers from them.
NPUNeural processing unit, the low-power AI accelerator in Intel Core Ultra chips.
Tool parserThe OVMS setting (--tool_parser) that reads a tool call out of the model's text. The right one depends on the model family.
KV cacheMemory the server keeps per request so it does not recompute earlier tokens. It grows with the conversation and the answer.
SubagentAnother agent the main agent can hand a whole task to: a second workflow in the same process, a model behind any OpenAI-compatible API, or an agent reached over A2A.
A2AAgent2Agent, an open protocol for agents asking each other questions over HTTP. Each agent publishes a public card that says what it can do.
ApprovalThe pause before a tool runs. Each tool is allow, ask or deny; when it asks, a person answers once, for the session, or always.
TraceA JSON record of one run: latency and tokens, which tools ran, and whether the run failed. Written by ovat run --trace.

What OVAT is

OVMS runs the model: it generates text, decodes tool calls, batches requests and targets a device. It does not decide which model, which device, which parser, which tools, or when to start and stop. OVAT turns that gap into a config file, the way kubectl wraps the Kubernetes API rather than replacing it. One workflow.yml in, one wired agent out.

There are two ways to run the model. Through OVMS (model.provider: ovms, the default) is the agent path: ovat run, ovat bench and ovat agent. OVMS decodes tool calls, so the agent can use tools; Windows and Linux only. In-process, through openvino_genai (ovat chat) needs no server and makes no tool calls: OVAT searches your documents first, then hands the passages to a local model. That path also works on macOS.

What is in scope and what is not
OVAT doesOVAT does not
Config to a wired agentInference (OVMS or openvino_genai does it)
Run the tool-calling loopModel conversion (optimum-cli)
Manage the OVMS processServe other people's traffic
Suggest a CPU, GPU or NPU device per modelProvide user accounts (the A2A server checks bearer tokens only)
Register tools, local and MCPHost anything
Six layers: interfaces, configuration, agent engines, providers and tools, serving and runtime, Intel hardware. Telemetry reads the engines, serving and hardware alongside the stack. A plano gateway is optional and outside OVAT.Six layers: interfaces, configuration, agent engines, providers and tools, serving and runtime, Intel hardware. Telemetry reads the engines, serving and hardware alongside the stack. A plano gateway is optional and outside OVAT.
The CLI loads and validates workflow.yml, the agent factory builds the agent, and the engine loops: it sends the history and tool schemas to OVMS, runs any tool the reply asks for and adds the result, until a reply has no tool calls. The answer, a sources line and an exit code come back.The CLI loads and validates workflow.yml, the agent factory builds the agent, and the engine loops: it sends the history and tool schemas to OVMS, runs any tool the reply asks for and adds the result, until a reply has no tool calls. The answer, a sources line and an exit code come back.

Design principles

Four principles shape the code. The reasons behind each one, with the alternatives and measurements that settled them, are in docs/DECISIONS.md.

Optional parts stay optional

The core install runs every command without the terminal UI or any agent framework. tests/test_tui_isolation.py checks that the CLI never imports textual at module level, and a CI job installs the base package alone to check that no framework or TUI package comes with it.

The agent core does not depend on the UI

ovat/agent/ never imports from the CLI or the TUI. Text helpers both need live in a neutral ovat/text.py.

Single source of truth

Each fact has one owner, and everything else derives from it. The list is below.

Errors are written for the reader

A failure becomes something the model or the person can act on. The error contract is below.

Single source of truth: who owns each fact

The owner of each fact
FactOwnerHow the rest derives from it
Tool contractseach tool's SCHEMA dict, next to its codeevery engine builds its argument models from it through agent/arg_models.py; no engine keeps its own copy
Config validityconfig/workflow.pya strict pydantic schema; unknown keys are errors
Config loadingmain._load_configthe only caller of load_workflow
Connection settingsLLMBackend.from_config in providers/backend.pyread by all four engines
Coloursui.PALETTEused by the CLI and the TUI alike
The OVMS versionovms_installer.OVMS_VERSIONthe installer, the docs and the tests read it

The error contract

a tool error

Goes back to the model as the tool result, as text starting with Error:, so the model can read it and try again. This covers an unknown tool name, a tool that raises, and arguments that are not valid JSON. The native loop and the OpenAI Agents engine wrap every tool this way; LangChain and LlamaIndex get the tool function unwrapped, so their own handling applies.

a failed run

Exits non-zero. ovat run exits 1 when the native trace says failed, when a framework engine sets last_failed, when the answer still holds raw tool-call markup, or when the run raises. The answer and any diagnostics are printed first.

the trace

With --trace, the trace file is written on every path, success or not. The native trace totals carry four flags: failed, undecoded_tool_call, truncated and empty_answer; a run that raised also gets an error field.

a CLI error

One readable sentence, not a traceback. A missing config file, YAML that does not parse and a schema mismatch each get their own sentence. A server error reads "Error talking to OVMS at ...", and a timeout also names model.request_timeout and how to raise it.

Required and optional parts

What you need depends on what you run. The Python extras come from pyproject.toml.

Python packages and extras
PartInstallWhat it adds
Corepip install ovatEvery command, the native engine, the three built-in tools, the MCP client, RAG with sqlite-vec, and local models through openvino and openvino-genai
[tui]pip install "ovat[tui]"textual and pyfiglet: the full-screen terminal UI
[langchain]pip install "ovat[langchain]"agent.type: react
[llamaindex]pip install "ovat[llamaindex]"agent.type: llamaindex
[openai-agents]pip install "ovat[openai-agents]"agent.type: openai-agents
[convert]pip install "ovat[convert]"optimum-cli, to convert a Hugging Face model such as the bge-small embedder. It pulls in torch, so it is not in the core
[dev]pip install -e ".[dev]"pytest and every framework and TUI package: the test suite
Programs and services outside the Python package
Outside the packageHow to get itNeeded forNot needed for
OVMSovat setup (Windows and Linux x86-64)tool-calling runs: ovat run, ovat bench, ovat agentovat chat, ovat index with local embeddings, ovat init, ovat doctor
An LLM exportovat serve pulls it, or hf downloadanything that generates textovat index, ovat doctor
An embedding modeloptimum-cli from [convert]RAG: ovat index, search_docs, ovat chatruns with no rag: section
Intel GPU and NPU driversIntel's driver downloadsrunning on GPU or NPUCPU
MCP serversany MCP stdio serverextra tools through type: mcp_stdiothe built-in tools
Intel Unified Telemetrya separate download from Intelthe power and bandwidth rows in telemetryevery other telemetry row
plano gatewaya separate install, see examples/plano/per-request OpenTelemetry spanseverything else; it runs outside OVAT

Config cli/main.py, config/workflow.py, cli/ui.py

Commands and configuration

Every command is a Python function that Typer turns into ovat <command> from its type hints. There are twelve: run, chat, index, init, doctor, setup, serve, models, bench, telemetry, tui and agent, plus the ovat a2a group (serve, card, call, token). A bare ovat, ovat tui, and ovat agent all open the agent TUI.

The config is strict. WorkflowConfig is a pydantic model that forbids unknown keys. A typo such as max_iteration fails at once, by name, instead of being ignored while the default stays in charge.

Only one function loads it. _load_config() in cli/main.py turns three different failures into three plain sentences: the file is missing, the YAML does not parse, or the schema does not match. yaml.safe_load(f) or {} makes an empty or comments-only file a schema error that names the missing section.

Model text is data, not markup. Every value that reaches the console goes through esc(), because the console library reads [...] as a style tag. Model output, exception text and file paths are data.

file missing

Names the path it looked for, and notices when a question was typed where the file name belongs.

bad YAML

Gives the line and column where parsing stopped.

schema error

Lists each field and what was wrong with it, and explains that unknown keys are rejected on purpose.

Every command loads workflow.yml through _load_config(), the only loader: yaml.safe_load parses it, WorkflowConfig validates it with extra=forbid, a model validator fills tool_parser from the model name, and build_agent() receives it. A missing file, bad YAML or a schema error each become one sentence.Every command loads workflow.yml through _load_config(), the only loader: yaml.safe_load parses it, WorkflowConfig validates it with extra=forbid, a model validator fills tool_parser from the model name, and build_agent() receives it. A missing file, bad YAML or a schema error each become one sentence.

Engines agent/*_agent.py, agent/arg_models.py, providers/backend.py

Four engines behind one method

Every engine exposes the same .run(text) -> text. The factory hands back one of them and the CLI never knows which. In C++ terms it is one interface with four implementations.

Two things keep the four consistent. Tool arguments for every engine are derived from each tool's own SCHEMA by agent/arg_models.py, so no engine keeps a second copy. And the server connection (URL, model, timeout, temperature, token cap) is described once, by LLMBackend.from_config in providers/backend.py, which all four read.

Token counts. OVMS returns token usage on every reply, and all four engines record prompt and completion tokens from its usage field, plus tool counts. The native loop records them per turn. The three framework engines record run totals in the same trace shape (agent/usage.py), summed from what each framework kept. A reply with no usage leaves the cell a dash, never 0.

Only LlamaIndex and the OpenAI Agents SDK own an event loop. Those two engines are async and call asyncio.run themselves, which cannot be re-entered, so they check for a running loop and raise a readable error rather than deadlock. LangChain calls invoke() synchronously. In the terminal UI all four work, because AgentSession runs the agent on a worker thread where no loop is running.

Four engines, one backend native, react, llamaindex and openai-agents each connect to LLMBackend, one shared description of the OVMS connection, which talks to the same OVMS server. agent/loop.pynative LangChainreact LlamaIndexllamaindex OpenAI Agents SDKopenai-agents providers/backend.pyLLMBackendone shared description the same serverOVMS /v3same model, same tools
workflow.yml
agent:
  type: native
What
OVAT's own loop in agent/loop.py. No extra library.
Run
--native
Install
Included in pip install ovat
Tokens
Prompt and completion tokens from OVMS's usage field, per turn, plus tool counts.

Agent core agent/loop.py, agent/session.py

The native loop gives the model hands

A model can only write text. The native loop in agent/loop.py is what turns its written request into a real function call. Each round has four beats: ask, read, act, report. Below, one real question from the RAG example goes round twice.

The native agent loop Four beats in a circle: ask the model, read the reply, act by running a tool, report the result. A reply with no tool calls leaves the circle as the answer. round 1 max_iterations: 10 1 askModel 2 readReply 3 actRun tool 4 reportHistory no tool callsAnswer
1 / 6
  1. Ask. Send the whole conversation plus the tool menu. Each menu entry is the tool's own SCHEMA, sent as is.
  2. Read. The reply carries a call: search_docs with a query about the memory budget. The loop checks the reply's content, not its finish_reason label.
  3. Act. The loop runs the Python function itself. If the arguments are broken JSON, that error goes back to the model as the tool result, so it can fix it.
  4. Report. The chunks and their source path are added to the history as a tool message. Round two starts.
  5. Ask again, now with the search result in the conversation.
  6. No tool calls: that is the answer. Every exit goes through one _finish, so the trace totals are always filled in. After ten rounds the loop stops and says why.

Why the content and not the label: OVMS documents that on the NPU finish_reason is always "stop", even when a tool call was decoded.

Ask, read, act, report, until no tool calls come back or the round cap is hit. A reply labelled tool_calls with none sent is reported, not re-asked. Leftover markup is undecoded_tool_call, reasoning only is empty_answer, and a real answer comes back with the trace.Ask, read, act, report, until no tool calls come back or the round cap is hit. A reply labelled tool_calls with none sent is reported, not re-asked. Leftover markup is undecoded_tool_call, reasoning only is empty_answer, and a real answer comes back with the trace.

Memory is just a list. A model forgets everything between calls, so agent/session.py keeps the conversation and resends it each time. It is thread-safe because the terminal UI streams an answer on one thread while you can save or load on another; it copies the list under a lock and writes the file outside it.

Small models get some slack. Arguments wrapped in a Markdown code fence are unwrapped before parsing, a misspelt tool name is matched to the closest real one and the trace records the tool that ran, and a slightly wrong file path is swapped for the closest real file, always with a note in front of the result saying so.

Providers providers/

Models, embeddings and search: sockets and plugs

providers/base.py defines four abstract classes: the sockets. Each concrete class beside it is a plug. The config names a plug as a string, so swapping a backend is a YAML edit. The agent loop and all four engines only ever see the interface.

LLMProvider

  • ovms OpenAI SDK to OVMS /v3. Can call tools.
  • genai openvino_genai in your process. No tools, no server.

EmbeddingsProvider

  • genai Local text embedding pipeline, bge-small.
  • ovms OVMS /v3/embeddings.

RetrieverProvider

  • sqlite-vec Vectors and text on disk; survives restarts.
  • memory numpy in memory; leaves nothing behind.

VLMProvider

  • genai OpenVINO VLMPipeline, used by describe_image.
Four interfaces with their backends. LLMProvider: OVMS over the OpenAI SDK, which does tool calling, or openvino_genai in-process, which does not. EmbeddingsProvider: a local TextEmbeddingPipeline or OVMS /v3/embeddings. RetrieverProvider: sqlite-vec on disk or numpy in memory. VLMProvider: openvino_genai VLMPipeline.Four interfaces with their backends. LLMProvider: OVMS over the OpenAI SDK, which does tool calling, or openvino_genai in-process, which does not. EmbeddingsProvider: a local TextEmbeddingPipeline or OVMS /v3/embeddings. RetrieverProvider: sqlite-vec on disk or numpy in memory. VLMProvider: openvino_genai VLMPipeline.

Document search, end to end

RAG means retrieval-augmented generation: find the right passages first, then let the model answer from them. OVAT does it in two phases. ovat index runs once; search_docs runs whenever the model asks, and ovat chat always searches first.

Index once, then search Indexing reads a folder, slices files into overlapping chunks, embeds each with bge-small into 384 numbers and stores them in sqlite-vec. A search embeds the question with the same model, finds the nearest chunks and returns text with source paths. ovat index, once search_docs, on every question a folderYour docs.txt and .md rag/indexer.pyChunks512 chars, 64 overlap embeddings_genai.pybge-small384 numbers each retriever_sqlitevec.pysqlite-vecovat_index.db the model callssearch_docsquery, top_k = 5 same embedderbge-smallquestion to numbers vector searchNearest chunksclosest in meaning tool resultText + sourceprinted as sources:
1 / 6
  1. Read the folder. ovat index walks every .txt and .md file under it.
  2. Slice into chunks. 512 characters each, with 64 shared with the next, so a sentence on a boundary is whole in at least one chunk.
  3. Store meaning as numbers. bge-small turns each chunk into 384 numbers. Re-indexing a file replaces its old chunks, so running it twice adds nothing.
  4. Later, the model asks. It calls search_docs, and the question is embedded with the same model.
  5. Find the closest chunks. Close in meaning, not in spelling. sqlite-vec returns the top k.
  6. Return text and its source path. OVAT prints the paths itself as sources: rather than hoping the model cites them.

The index remembers when it read each file. ovat index writes <db>.sources.json beside the database, and ovat run and ovat chat name any file that changed or vanished since. The nearest-neighbour query uses sqlite-vec's own k = ? form, which works on every SQLite version OVAT supports, and CI runs on Ubuntu 22.04 to cover the oldest one.

Tools tools/

Three built-in tools, and any MCP server

Each built-in tool follows one pattern: a plain *_impl() function you can unit test, a SCHEMA dictionary beside it that is the tool's contract, and a FastMCP wrapper so the same file also runs as a standalone MCP server.

MCP is a standard way for a program to offer tools to any agent. OVAT is an MCP client too: declare type: mcp_stdio, and the factory starts the server, asks it which tools it offers, and hands them to the loop in the same shape as the built-ins. The loop cannot tell them apart.

Built-in tools
ToolInOutRuns on
search_docsa question, top_k (default 5)matching chunks with their source pathyour index, via the embedder
transcribea path to an audio filethe transcriptWhisper, CPU by default
describe_imagea path to an imagea descriptiona vision model; Qwen3.5 is one export for text and vision
A tool is either builtin, with its schema from SCHEMA and a function bound by the factory, or mcp_stdio, where MCPStdioServer launches the server, lists its tools and calls them. Both reach the agent loop in the same shape, so the loop cannot tell them apart.A tool is either builtin, with its schema from SCHEMA and a function bound by the factory, or mcp_stdio, where MCPStdioServer launches the server, lists its tools and calls them. Both reach the agent loop in the same shape, so the loop cannot tell them apart.

The MCP client is sync over async. The mcp SDK is asynchronous, the loop is not. Each server gets one background thread with one event loop and one manager coroutine that connects, serves and unwinds. Closing sets an event and lets that coroutine unwind itself, because the SDK's cancel scopes must be entered and left by the same task.

A server gets a short environment. An MCP server starts with only HOME, LOGNAME, PATH, SHELL, TERM and USER, so a third-party server cannot read every secret in your shell. tools[].env passes more, and ${VAR} in a value is read from your shell.

A separate process needs the config, not the object. An MCP server is a new Python process, and objects do not cross that line, so an MCP-served search_docs takes --config and builds its own retriever from the workflow.

Serving core/ovms_installer.py, core/model_server.py, core/ovms_locator.py

Getting OVMS installed, started and stopped

ovat setup picks the right OVMS archive for your OS (and, on Linux, your distribution), checks its SHA-256, and unpacks it into ~/.ovat/ovms. Nothing is added to PATH. It always takes the python_on build: the python_off build cannot do tool calling. The pinned version, OVMS 2026.4.1, lives in one place, ovms_installer.OVMS_VERSION, and ovat setup and ovat doctor both say when the installed binary differs from it.

It is a command rather than part of pip install because the archive is 126 to 185 MB, Linux needs three different builds, wheels have no post-install step, and macOS has no build at all.

ovat setup checks the platform: macOS has no build and exits 0, Windows gets the Python-enabled zip, Linux reads /etc/os-release and falls back to ubuntu24 with a warning. It downloads the archive, checks the SHA-256 when one is published, refuses on a mismatch, then extracts into ~/.ovat/ovms.ovat setup checks the platform: macOS has no build and exits 0, Windows gets the Python-enabled zip, Linux reads /etc/os-release and falls back to ubuntu24 with a warning. It downloads the archive, checks the SHA-256 when one is published, refuses on a mismatch, then extracts into ~/.ovat/ovms.

Where OVAT looks for the server, in order

  1. model.ovms_binaryin your YAML
  2. OVAT_OVMSenvironment variable
  3. PATHthe classic place
  4. ./ovms ~/.ovat/ovms ~/ovms_windows ~/ovms C:\ovmsknown folders

A stall budget, not a deadline

The first ovat serve downloads the model, about 185 s for Qwen3.5-4B and longer on a slow link. The clock resets whenever the log or the model folder grows, and gives up only after 300 s of no progress at all.

Logs go to a file

A pipe nobody reads fills its buffer, around 64 KB, and the server freezes. OVMS writes to ovms.log instead.

Stop checks identity

ovat serve --stop reads ovms.pid and confirms the process really is OVMS before signalling it, because a stale PID can belong to another program.

find_ovms() looks in the config, OVAT_OVMS, PATH and known folders. If OVMS is missing it offers ovat setup at a terminal and refuses otherwise. If found, ovms_env() sets the environment, Popen starts OVMS with logs to a file, and wait_until_ready() watches for progress: ready on health 200, a report if the process exits, a still-running note after 300 s with no progress.find_ovms() looks in the config, OVAT_OVMS, PATH and known folders. If OVMS is missing it offers ovat setup at a terminal and refuses otherwise. If found, ovms_env() sets the environment, Popen starts OVMS with logs to a file, and wait_until_ready() watches for progress: ready on health 200, a report if the process exits, a still-running note after 300 s with no progress.

Devices core/device_manager.py

A suggested device for each model

core/device_manager.py asks OpenVINO which devices exist, then looks the answer up in a routing table. The result is a default suggestion: ovat doctor shows it, ovat init writes the suggested LLM device into a new workflow.yml, and the transcribe and describe_image tools use it when their own device: is not set. Any model can run on any device OpenVINO supports for it. In workflow.yml, model.device defaults to CPU, and whatever you set there wins. Pick a machine to see the suggestions.

Suggested devices The default suggestion: the LLM on the GPU when one exists, embeddings on the NPU when one exists, Whisper on the CPU, and everything on the CPU otherwise. Any model can be set to any device. chat and tool callsLLM document searchEmbeddings transcribe toolWhisper always presentCPU Intel ArcGPU Intel AI BoostNPU

A Mac or a plain laptop. OpenVINO reports ['CPU'], so every suggestion is the CPU. Low-bit weights keep a model in memory.

These are suggestions. The LLM ran a tool-calling agent on the NPU too, from a channel-wise INT4 export (-int4-cw-ov). See the NPU results.

No device runs tools. The device runs the model. The agent loop reads the tool call out of the generated text and runs the Python function itself, so tool calling depends on the model and the parser, not the hardware.

Where the models come from. OpenVINO publishes models already converted and optimised per device on Hugging Face, in the OpenVINO organisation. Some are tuned for one device, such as the LLMs optimised for NPU collection, and many run well on more than one. For serving an LLM on the NPU in OVMS, the export OVAT has measured working is the channel-wise INT4 one, the -int4-cw-ov models.

What serving an LLM on the NPU through OVMS involves
Serving an LLM on the NPUWhy it matters
A channel-wise symmetric INT4 export, the -int4-cw-ov familyMeasured working with tool calling; the stock -int4-ov export tried here did not compile on the NPU.
A prompt length cap, set with --max_prompt_lenOVMS defaults to 1024 tokens on the NPU; OVAT raises it to 4096 because an agent prompt grows every round.
No batching, no beam searchRequests are handled one at a time.
KV cache settings are ignoredThe NPU runs a fixed-shape pipeline instead, with a hard total-length cap.
At startup OVAT checks the devices. CPU only: everything on the CPU. CPU and GPU: the LLM on the GPU, embeddings and whisper on the CPU. CPU, GPU and NPU: the LLM on the GPU, embeddings on the NPU, whisper on the CPU. Serving an LLM on the NPU needs an int4-cw-ov export, a capped prompt, no batching or beam search, and ignores KV cache settings.At startup OVAT checks the devices. CPU only: everything on the CPU. CPU and GPU: the LLM on the GPU, embeddings and whisper on the CPU. CPU, GPU and NPU: the LLM on the GPU, embeddings on the NPU, whisper on the CPU. Serving an LLM on the NPU needs an int4-cw-ov export, a capped prompt, no batching or beam search, and ignores KV cache settings.

Model discovery (core/model_scout.py). A unified export such as Qwen3.5 stores vision and language weights side by side, so OVAT reads config.json first and labels those folders unified rather than vision-only.

If a folder has openvino_vision or openvino_language_model files and its model_type is a unified type (qwen3_5, qwen3_5_text, qwen3_6), its kind is unified and one VLMPipeline answers both filters. Other vision models (qwen2_vl, internvl_chat, phi3_v) are vlm. Folders without those files go to the other checks: whisper, embeddings, or an LLM.If a folder has openvino_vision or openvino_language_model files and its model_type is a unified type (qwen3_5, qwen3_5_text, qwen3_6), its kind is unified and one VLMPipeline answers both filters. Other vision models (qwen2_vl, internvl_chat, phi3_v) are vlm. Folders without those files go to the other checks: whisper, embeddings, or an LLM.

Telemetry telemetry/, agent/loop.py

Telemetry: sources, a collector, sinks

OVAT collects machine and process metrics (CPU per core, RAM, threads, its own resident memory), NPU busy %, KV cache usage from ovms.log, power and bandwidth from Intel Unified Telemetry when it is installed, and the per-run agent trace: latency, tokens, tool calls, failure flags and peak memory.

Where a number comes from (a source) and where it goes (a sink) are separate contracts, so any source feeds any sink. The collector polls every source on its own thread, once a second by default, so a stuck sensor cannot slow the agent.

There is no OTLP exporter. OVAT's telemetry goes to a JSON Lines file or the live terminal UI page. Per-request OpenTelemetry spans come only from the optional plano gateway, which runs outside OVAT; OVAT has no OpenTelemetry dependency of its own. plano measures the transport (latency, time to first token, HTTP status); OVAT measures what the agent did.

Telemetry: sources, collector, sinks Six sources (agent trace, process memory, system, NPU, Intel hardware, OVMS log) feed one collector, which writes to a JSON Lines file, a live buffer for the terminal UI, and a fan-out sink. AgentTraceSource ProcessMemorySource SystemSource NPUSource IntelHardwareSource OVMSLogSource telemetry/collector.pyCollectorticks on a clock JSONFileSink--telemetry run.jsonl LiveBufferSinkthe TUI telemetry page FanOutSinkone feed, many sinks
Samples flow from each source to the collector, then out to the sinks.

Absent is not zero

No token count from the server is null, shown as a dash. A 0 would read as "used no tokens", and a benchmark built on it would be wrong.

An unavailable source says why

On macOS the Intel row reads "Intel Unified Telemetry does not run on macOS" instead of showing zeros. A missing sensor and an idle one look the same in a graph.

Peak memory is sampled during the run

A reading taken afterwards misses the peak, because Python has already freed the big allocations. With OVMS serving, the model's memory lives in the server process, not in OVAT.

ovat bench runs each engine in a fresh process, because memory is a whole-process number: engines sharing a process would inherit each other's allocations. The measurement is on the results page.

ovat run points ovms_url at :8000/v1, where plano (Envoy) listens and records OpenTelemetry spans. Requests pass through ovms_id_bridge.py on :8001 to OVMS on :8002/v3, the port in model.ovms_port. planoai obs shows latency, time to first token and tokens.ovat run points ovms_url at :8000/v1, where plano (Envoy) listens and records OpenTelemetry spans. Requests pass through ovms_id_bridge.py on :8001 to OVMS on :8002/v3, the port in model.ovms_port. planoai obs shows latency, time to first token and tokens.

Agentic agent/events.py, agent/permissions.py, agent/subagents.py, agentic/, tui/

The agent TUI, permissions and subagents

ovat agent workflow.yml opens a terminal app for working with an agent: you type, it answers, and everything it does is drawn on the screen. It needs the tui extra. This part was added after the nine layers of the proposal and sits on top of them, so every engine gets it.

Three layers, each talking to the next through a small interface. The terminal client in ovat/tui/vibe/ is a copied Apache-2.0 client (the licence and a NOTICE file travel with it). It knows nothing about OVAT's engines: it sends JSON-RPC requests and draws what comes back. The app server in ovat/tui/server/ is OVAT's own and answers those requests from OVAT's state. Under it, AgentSession in ovat/agentic/ runs the engine on a worker thread and has no UI code; a test scans the folder to keep Textual out of it.

You type in the terminal client. It sends a JSON-RPC request to OVAT's app server, which starts a turn on AgentSession. AgentSession runs the chosen engine on a worker thread; the engine asks the model on OVMS, and every tool call goes through one wrapper that reports events. The events travel back up the same layers and the client draws them.You type in the terminal client. It sends a JSON-RPC request to OVAT's app server, which starts a turn on AgentSession. AgentSession runs the chosen engine on a worker thread; the engine asks the model on OVMS, and every tool call goes through one wrapper that reports events. The events travel back up the same layers and the client draws them.
The OVAT agent TUI right after start on an Intel AI PC: the banner says Qwen3.5-4B-int4-ov on GPU, native engine, 1 tool and 4 subagents. The slash menu is open, and the bottom bar shows live CPU, GPU, NPU and RAM.

One wrapper for every engine. All four engines call the same tool functions, so the factory wraps each one once (agent/events.py). The wrapper reports tool_started and tool_ended on the agent's event bus, checks the cancel flag, and asks the permission check below. The TUI draws its tool cards from that bus. No engine file changed to get any of this.

Coding tools. The file tools resolve every path through tools/project.py, which rejects anything outside the project folder, symlinks included. Writes go to a temporary file that replaces the target, so a failure leaves the old file. shell starts in the project folder but is not confined to it, and edit matches on LF text and puts the file's own line ending back.

Permissions: allow, ask or deny

Each tool and each subagent is allow, ask or deny. When a tool asks, the ApprovalBroker holds the worker thread until the person answers once, for the session, or always. A cancel denies everything waiting.

The model asks for a tool. One wrapper checks the permission of that tool or subagent. Allow runs it. Ask opens an approval panel with once, session, always and deny when someone is there to answer, and counts as no when nobody is. Deny sends the model a plain sentence.The model asks for a tool. One wrapper checks the permission of that tool or subagent. Allow runs it. Ask opens an approval panel with once, session, always and deny when someone is there to answer, and counts as no when nobody is. Deny sends the model a plain sentence.
nobody to ask

With no approver connected, ask means NO. So ovat run, a bench worker and an A2A server never send data out unasked.

always allow

Saved per project in ~/.ovat/, never in the project's own .ovat/ folder. A cloned repository could otherwise ship a file that switches on "always allow" for shell.

Subagents

subagents: in the YAML become one tool, delegate(agent, task), where agent is an enum of the names. Three kinds sit behind it. A workflow subagent runs in the same process with a fresh context and its own delegate tool removed, so delegation is one level deep. An api subagent is any OpenAI-compatible API. An a2a subagent is a remote agent. They share the parent's stop flag and approver, and their progress shows in the /agents screen.

The main agent gets one tool, delegate(agent, task). A subagent is another OVAT workflow in this process, a model behind an OpenAI-compatible API, or an agent reached over A2A. Answers come back framed as information. Progress is reported as events and shown in the agents table.The main agent gets one tool, delegate(agent, task). A subagent is another OVAT workflow in this process, a model behind an OpenAI-compatible API, or an agent reached over A2A. Answers come back framed as information. Progress is reported as events and shown in the agents table.
The /agents screen: the A2A server is serving, four configured subagents, and a table with the team_docs call finished ok in 12.51 seconds with 1663 tokens.

Also in the app: /config is drawn from the same schema as workflow.yml and saves through an all-or-nothing writer that keeps the file's comments; /model switches model; /telemetry and /doctor show the same numbers and checks as the commands; Ctrl+R is local dictation with Whisper. Workspace trust is recorded per user in ~/.ovat/trusted.json (ovat/agentic/trust.py): ./workflow.yml only loads automatically in a trusted folder (/trust or --trust), so a cloned project cannot start its mcp_stdio servers unasked. The screen-by-screen walk-through is docs/AGENT_TUI.md.

Orchestration ovat/a2a/, tools/a2a_call.py, cli/a2a_cmd.py

Multi-agent orchestration (A2A)

A2A lets agents ask each other questions over HTTP. Each agent publishes a public card at /.well-known/agent-card.json that says what it can do, and takes messages with the JSON-RPC method SendMessage. OVAT does both sides. It needs the a2a extra; the spec is v1.0 and the SDK is a2a-sdk 1.2.

ovat a2a serve

Offers a workflow to other agents.

type: a2a

A tool that lets a workflow ask another agent, OVAT or not. The reply is framed as information, not instructions, and a failure is one Error: sentence.

card, call, token

ovat a2a card prints the card without starting anything, call asks an agent one question from the shell, token makes a bearer token.

A caller sends a message. The server checks the host, the body size and the bearer token, then admission limits, then gives each caller and conversation its own agent. A run takes the conversation lock and then the one-model gate, runs only the exposed tools, and the answer comes back as a task update.A caller sends a message. The server checks the host, the body size and the bearer token, then admission limits, then gives each caller and conversation its own agent. A run takes the conversation lock and then the one-model gate, runs only the exposed tools, and the answer comes back as a task update.

Safe by default. The server listens on 127.0.0.1 only and wants a bearer token even there, because a web page can reach a loopback port too; it also refuses a request whose Host header is not its own. Listening elsewhere needs public_url and TLS, or an explicit --allow-plain-http. Tools that take a file path, MCP tools and a2a tools are not exposed unless listed in a2a.server.expose_tools, and an unexposed tool is not just left off the card: the served agent is built without it. There are limits on message size, queue, rate, run time, conversations, turns and hops, so two agents cannot call each other forever.

What leaves the machine. The question, the answer, source file names, tool names and the run's token counts and timings. Documents, the index, the model, the system prompt, tool arguments and full file paths stay. Because an answer is made from private data and a model can quote a document, treat anything a served workflow has indexed as readable by every token holder. Every answer that leaves is written to an audit log that only its owner can read.

Built so the SDK can change. The SDK shipped four versions in the two weeks this was designed, and its 1.0 moved every type to protobuf. So OVAT's own logic (protocol.py, exposure.py, card.py, policy.py, tokens.py, audit.py, service.py, serving.py) never imports it. Only ovat/a2a/sdk/ does, and a test scans the source to keep it that way. An SDK upgrade is a change to that folder alone.

One model, many callers. One OVMS on one GPU is the bottleneck, so tasks take turns behind one lock, and a waiting caller is told how many are ahead. The lock is a threading lock held by the worker, not an asyncio lock, because a cancelled task's thread keeps using OVMS until its request ends. Each conversation (caller plus context id) gets its own agent, so callers never share memory. Live progress comes from the same tool wrapper as the TUI: the server turns tool_started events into "calling search_docs" updates and never sends tool arguments.

After /serve the A2A server listens on 127.0.0.1 port 9100, the TUI asks it a question through the team_docs subagent and gets a cited answer, and the bar shows a2a serving.

Remote approvals are built as a server opt-in (a2a.server.allow_remote_approvals, off by default): the worker releases the model gate while waiting for an answer and drops late or mismatched replies. Still untested on hardware here: GPU and NPU execution under OVMS on Linux (WSL2 has no /dev/dri).

Cross-cutting failure detection

Four ways a tool call goes wrong, each with a name

All four end the same way: the agent answers fluently and has called nothing. That is the hardest kind of broken to notice, so the loop detects each one and sets a flag in the trace. ovat bench scores on those flags, not on the answer text, and ovat run checks the final answer for markup on every engine.

truncated

The reply was cut at max_tokens (4096 by default), so any tool-call markup is a fragment. Detected from finish_reason: "length", so it is never blamed on the parser.

undecoded_tool_call

Raw <tool_call> markup reached the answer: no parser matched, or the model wrote the call malformed. Usually the wrong tool_parser.

empty_answer

Nothing is left once the reasoning is removed. The parser swallowed the reply.

a real answer

Text remains, with no markup in it. The run exits 0. Every other case exits non-zero, writes its trace, and cleans up.

The broken markup is deliberately not repaired into a tool call. Guessing at broken output trades a loud failure for a silent wrong answer.

If tool markup is still in the text and finish_reason is length, the reply was cut at max_tokens and the markup is a truncated fragment. Markup without length is undecoded_tool_call: the server did not decode it. No markup and nothing after the reasoning is empty_answer. Otherwise it is a real answer.If tool markup is still in the text and finish_reason is length, the reply was cut at max_tokens and the markup is a truncated fragment. Markup without length is undecoded_tool_call: the server did not decode it. No markup and nothing after the reasoning is empty_answer. Otherwise it is a real answer.

Appendix mapping to the proposal

Mapping to the GSoC proposal's layers

The project proposal described OVAT as nine numbered layers. This page is organised by what each part does instead; this list maps one to the other.

  1. 1CLI and configurationCommands and configurationbuilt
  2. 2Framework integrationAgent enginesbuilt
  3. 3Agent coreThe native loopbuilt
  4. 4Provider abstractionProviders and RAGbuilt
  5. 5Tools and MCPTools and MCPbuilt
  6. 6Orchestration (A2A)Multi-agent (A2A)built
  7. 7TelemetryTelemetrybuilt
  8. 8Deployment and servingServing the modelbuilt
  9. 9OpenVINO runtime and hardwareDevicesbuilt