Search by

hryvinskyi / magento2-llm

hryvinskyi

Language models for Magento 2 modules: typed decisions and short texts through a provider the merchant configures, with credentials, limits and a call journal; providers ship as separate modules

Package info

github.com/hryvinskyi/magento2-llm

Type:magento2-module

pkg:composer/hryvinskyi/magento2-llm

Statistics

Installs: 0

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-11-30 18:52 UTC

This package is auto-updated.

Last update: 2026-11-30 20:08:00 UTC


README

Language models for Magento 2 modules: typed decisions and short texts through a provider the merchant configures, with credentials, limits and a call journal; providers ship as separate modules.

What it does for a store

  • One place to connect a language model. The merchant picks a provider, enters its key and chooses a model in a setup wizard; every module that uses a model goes through this connection. Providers come from provider modules, each speaking one wire protocol.
  • Two abilities for other modules. Typed decisions: questions about a text answered as yes/no or a choice, with a confidence (Api\DecisionMakerInterface::decide()). Writing: a short text, or JSON bound to a schema (Api\TextWriterInterface::write()). A module registers each use as a feature with what it sends.
  • Spending under control. Each feature is off until switched on and has its own daily limit of requests; a monthly money budget covers every priced call, with a notice at 80 % and when it is used up (pause the features, or only warn).
  • A journal of every call with the tokens, the cost, who asked and, by default for 90 days, what was sent and answered; a Usage page shows the month.
  • This module names no vendor. It knows protocols and providers only as the data provider modules declare.

Requirements

  • PHP 8.4.1 or higher with ext-curl and ext-sockets; symfony/http-client and its contracts; psr/log.
  • The platform's Store, Config, Backend, UI, Cron and AdminNotification modules, and hryvinskyi/magento2-base, hryvinskyi/magento2-admin-ui and hryvinskyi/magento2-admin-setup-wizard (what composer.json and etc/module.xml declare).
  • At least one provider module.

Installation

composer require hryvinskyi/magento2-llm
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Admin pages

Page Address Access rule
System › AI Models › Setup (the wizard: Provider, Connect, Models, Features, Limits, then review) hryvinskyi_setup_wizard/wizard/index/id/ai_models Hryvinskyi_Llm::setup
System › AI Models › Usage hryvinskyi_llm/usage/index Hryvinskyi_Llm::usage
Stores › Configuration › Hryvinskyi Extensions › AI Models adminhtml/system_config/edit/section/hryvinskyi_llm Hryvinskyi_Llm::config

Configuration

Section hryvinskyi_llm, every field at the default scope only.

Group Settings Defaults
General general/enabled off
Decisions decision/provider, decision/yes_at, decision/no_at none, 0.85, 0.15
Writing writing/provider none
Limits limits/timeout, limits/max_output_tokens, limits/monthly_budget (US dollars), limits/at_limit (pause or warn), limits/warn_80 20 s, 400, none, pause, on
Call journal journal/keep_texts, journal/text_days, journal/retention_days on, 90, 90
One group per provider provider_<code>/credential, endpoint, model, strong_model, manual_prices (below) declared by the provider module

A feature's switch, provider, model, tier and daily limit are stored in the table hryvinskyi_llm_feature, edited from the setup wizard and the Usage page. In app/etc/env.php, hryvinskyi_llm/allow_private_addresses lets the transport reach private network ranges (a model served inside the network).

Using a model from another module

Register a feature as a virtual type of Hryvinskyi\Llm\Model\Feature\Feature in the features argument of Hryvinskyi\Llm\Model\Feature\FeatureRegistry, in the module's global etc/di.xml:

<virtualType name="VendorModuleDescribeFeature" type="Hryvinskyi\Llm\Model\Feature\Feature">
    <arguments>
        <argument name="key" xsi:type="string">vendor_describe</argument>
        <argument name="label" xsi:type="string">Describe an item</argument>
        <argument name="ability" xsi:type="string">writing</argument>
        <argument name="moduleName" xsi:type="string">Vendor_Module</argument>
        <argument name="disclosure" xsi:type="string">The item's name and kind. Never anything about a customer.</argument>
        <argument name="defaultDailyLimit" xsi:type="number">200</argument>
    </arguments>
</virtualType>
<type name="Hryvinskyi\Llm\Model\Feature\FeatureRegistry">
    <arguments>
        <argument name="features" xsi:type="array">
            <item name="vendor_describe" xsi:type="object">VendorModuleDescribeFeature</item>
        </argument>
    </arguments>
</type>

Then call TextWriterInterface::write() or DecisionMakerInterface::decide() with the feature's key. Every expected refusal (switched off, not set up, over a limit, a timeout, a malformed answer) is an outcome of the result, never an exception. A call made in a storefront or web API request throws: ask from the admin, a cron job or a console command. What the screens show about a feature is under How a feature is shown; why a button cannot run is under A feature's state.

Adding a provider

A provider module declares its providers as data in the providers argument of Hryvinskyi\Llm\Model\Provider\ProviderRegistry (label, protocol, abilities, default endpoint and model, whether a key and an endpoint are required, presentation, model catalogue), adds its protocol to Hryvinskyi\Llm\Model\Protocol\ProtocolPool (writingProtocols with an Api\Protocol\WritingProtocolInterface, decisionProtocols with an Api\Protocol\DecisionProtocolInterface), its connection test to Hryvinskyi\Llm\Model\Connection\ListingPool (listings) or Hryvinskyi\Llm\Model\Connection\ProbePool (probes), declares the fields of its group provider_<code> in system.xml, and marks each credential path sensitive in Magento\Config\Model\Config\TypePool. A protocol sends through Api\Protocol\HttpTransportInterface and nothing else.

Outbound requests

Every request goes through the module's transport:

  • https only (plain http only to this machine); no redirect is followed; TLS verification is always on;
  • the host is looked up once and every address checked: link-local (cloud metadata), unspecified and multicast addresses are always refused, private ranges unless the deployment configuration allows them; the connection is pinned to the address that was checked;
  • no proxy is used, whatever the environment's proxy variables say: a store that reaches the internet only through a proxy cannot call a provider;
  • a connect timeout and a total timeout; a cap on the answer's size (1 MiB) and headers; exactly one retry, after a failure to connect or a 429, 502, 503 or 504, never after a timeout;
  • a credential goes only to the endpoint it was saved with, is stored encrypted, and appears in no log, journal text or error.

Tables and cron

Tables hryvinskyi_llm_feature (feature settings), hryvinskyi_llm_call (the journal), hryvinskyi_llm_usage_day (daily counts, kept 400 days), hryvinskyi_llm_budget, hryvinskyi_llm_spend and hryvinskyi_llm_spend_reservation (the month's money, reserved before a call and settled after it), hryvinskyi_llm_provider_health (since when a provider refused its key). The daily job hryvinskyi_llm_purge_calls (03:23) keeps the journal, the daily counts and the money rows within their retention.

Testing a connection

The settings screens test a provider with Hryvinskyi\Llm\Api\ConnectionTesterInterface. When the provider's protocol lists its models, the test is the listing: it sends no model, so a provider whose model is not chosen yet can be tested, and it answers with the model ids the credential can use. Otherwise the test is the protocol's probe. A stored key still goes only to the endpoint it was saved for; a key typed for the test goes only to the endpoint typed with it, or to the stored one. Every request of a test has a total timeout of 10 seconds.

A result carries a reason code, the origin the test went to and, for a listing, the model ids: each a model name, at most 200, read from at most five pages. Nothing else of what an endpoint answered is kept, so a test cannot be used to read a service an address points at. Hryvinskyi\Llm\Model\Connection\TestWording words a result for the screens: a short status, a sentence of what to do, and a line with the origin and the outcome.

A protocol module adds its listing (Hryvinskyi\Llm\Api\Protocol\ModelListingInterface) to the listings argument of Hryvinskyi\Llm\Model\Connection\ListingPool in its global etc/di.xml, under its protocol code:

<type name="Hryvinskyi\Llm\Model\Connection\ListingPool">
    <arguments>
        <argument name="listings" xsi:type="array">
            <item name="example_protocol" xsi:type="object">Vendor\Module\Model\ModelListing</item>
        </argument>
    </arguments>
</type>

The listing builds the request for one page ('' for the first, else the cursor the last page named) and reads a 2xx answer into a page through Hryvinskyi\Llm\Api\Protocol\ModelPageFactoryInterface: the ids and the next cursor, nothing else. The core follows a cursor only when it is a short token of letters, digits and ._:=+/-. The listing puts the cursor into the request's query (the trailing $query of HttpRequestFactoryInterface::create()), which the transport encodes by RFC 3986; a query holds at most 8 parameters of printable ASCII, 1024 characters together, and a request whose query holds the credential is refused before it is sent.

The setup wizard

System › AI Models › Setup opens the admin setup wizard ai_models (access rule Hryvinskyi_Llm::setup). Its Provider step offers every provider that writes, by its presentation's sort order, then by name; a provider that only decides is still chosen on the configuration page. Its Connect step takes the endpoint (for a provider whose endpoint the merchant sets) and the API key, and tests them before anything is saved.

The connection is the wizard's draft item connection (Hryvinskyi\Llm\Model\Wizard\ConnectionItem), not a set of the wizard's settings: a provider's fields live at paths that exist per provider, and a key is bound to the endpoint saved in the same request. So the item has endpoints of its own, under the admin route hryvinskyi_llm:

  • wizard/test takes {provider, endpoint?, credential?}, runs ConnectionTesterInterface::test() with the typed endpoint and key (left out: the stored ones) and answers the reason codes, the model ids and the three phrases of TestWording. It never answers the key, nor anything the provider wrote.
  • wizard/saveConnection takes {provider, endpoint?, credential?, model?, strongModel?, prices?} and writes it in one configuration save at the default scope: the module switched on, the provider as the default writing and decision provider, and the fields sent. A key always goes out with an endpoint when its provider takes one — the one sent, else the stored one — so the key's save rule binds it to that endpoint's origin; a key with no endpoint to bind to is refused. The stronger model may not be the default one (same_models). prices maps a model id to {in, out} in US dollars per million tokens: only the default or the stronger model as they stand after the save, merged into the provider's stored manual prices (the model's row replaced, removed when both prices are empty, other models' rows kept) and checked by the manual prices' own rules, so a model the price list prices, or a price that is not one, is refused (invalid_prices). A field the deployment configuration fixes is refused rather than sent (prices_locked for the prices). A refused request writes nothing and answers 400 {"error": reason}.
  • wizard/saveFeatures takes {features: [{key, enabled, tier, dailyLimit}]} and stores each feature's switch, tier (default or stronger) and daily limit, keeping a provider and model the configuration page pinned the feature to; dailyLimit is a whole number from 1 to 1 000 000, or null to keep the stored one — the wizard never sets "no limit". A key no feature is registered under (unknown_feature) or a limit out of range (daily_limit) refuses the whole request before anything is written. It answers the features slice as now stored.

The Models step shows the provider's price list as model cards when the last test of the session listed models, and a typed model id otherwise. A model the price list does not price shows "Price not known" and offers Enter its prices: the two prices go out with the connection save and are then the model's manual prices, the same rows the configuration page's Manual prices field edits. What one request of each feature costs is counted in the browser from the typical tokens each feature's presentation declares, in whole billionths of a dollar, never through a float. The Features step is the draft item features (Hryvinskyi\Llm\Model\Wizard\FeaturesItem): every registered feature as its presentation shows it, with what it sends. The Limits step is a set of the wizard's own settings — monthly_budget, at_limit, warn_80, max_output_tokens, timeout at hryvinskyi_llm/limits/* — saved through the wizard package's save endpoint and each field's save rule. The monthly budget stops spending only on calls whose model has a price, so it is disabled while the default model has none (a stored budget is kept); the daily limits stop every feature by its number of requests, priced or not.

The item's slice, which the page prints, says of each provider's stored key only whether it is set and whether the deployment fixes it; no character of a key reaches the page. The step plug-in is built from frontend/ai-wizard/ (npm ci, npm run check, npm test, npm run build; npm run verify-build checks that the committed view/adminhtml/web/js/ai-wizard/plugin.js matches its sources).

Presentation and model catalogue

A provider's item in the registry's providers argument may carry two more kinds of data for the settings screens.

  • presentation: description (a source phrase), icon (a Material Symbols name), key_hint (a short placeholder such as a key's usual prefix, at most 24 characters, never a real key), console_hint (a source phrase saying where a key is made) and sort_order. Read through Hryvinskyi\Llm\Api\ProviderPresentationsInterface; a provider without one is shown with the icon cloud and its label.
  • models (item name = the model id) with description, context_tokens, price_in, price_out, recommended (at most one model) and aliases; and prices_as_of (YYYY-MM-DD, required when a model has a price). Prices are US dollars per million tokens, written as decimal strings with up to three decimals ("1.25"), both or neither. Read through Hryvinskyi\Llm\Api\ModelCatalogueInterface, which gives a price in billionths of a US dollar per token ("1.25" is 1250), so costs are integer arithmetic. A model is found by its exact id or a declared alias only.
<item name="example" xsi:type="array">
    <item name="label" xsi:type="string">Example</item>
    <!-- protocol, abilities, default_endpoint, ... -->
    <item name="presentation" xsi:type="array">
        <item name="description" xsi:type="string">Writes and translates short texts.</item>
        <item name="icon" xsi:type="string">auto_awesome</item>
        <item name="key_hint" xsi:type="string">ex-...</item>
        <item name="console_hint" xsi:type="string">Create a key in the provider's console.</item>
        <item name="sort_order" xsi:type="number">10</item>
    </item>
    <item name="models" xsi:type="array">
        <item name="example-small" xsi:type="array">
            <item name="description" xsi:type="string">Fast and inexpensive.</item>
            <item name="context_tokens" xsi:type="number">200000</item>
            <item name="price_in" xsi:type="string">1.25</item>
            <item name="price_out" xsi:type="string">5</item>
            <item name="recommended" xsi:type="boolean">true</item>
        </item>
    </item>
    <item name="prices_as_of" xsi:type="string">2026-11-14</item>
</item>

A catalogue is the declaring module's copy of the provider's public price list, as of its date: an estimate, and the provider's invoice is what counts. A presentation or a catalogue declared wrong fails with an InvalidDeclarationException naming the provider when its reader is first built; the provider itself keeps working.

Provider settings

A provider's settings live at paths this module publishes and reads alone, all in the default scope. For the provider with code <code>, the module that ships it declares these as fields of its group provider_<code> of the section hryvinskyi_llm; a path with no field or no value reads as empty.

  • hryvinskyi_llm/provider_<code>/credential, …/endpoint and …/model (the default model);
  • …/strong_model: the stronger model a feature may be pointed at; empty for none;
  • …/manual_prices: prices the merchant enters for models the provider's catalogue does not price (below).

…/credential_origin is written only by the credential's backend model.

Limits of a call

The group limits holds two settings every call keeps:

  • hryvinskyi_llm/limits/timeout ("Give up after": 10, 20 or 60 seconds, 20 by default). A connection carries it, and every request over the connection keeps it. A timeout a protocol names for its request is an upper bound: the smaller of the two counts, so a protocol may shorten the merchant's setting but never lengthen it. The connection test keeps its own 10 seconds, which no allowed setting is below. The transport's own default (the totalSeconds argument of Hryvinskyi\Llm\Model\Transport\HttpClientTransport) applies only to a request that names none over a connection that carries none.
  • hryvinskyi_llm/limits/max_output_tokens ("Longest answer": 200, 400 or 800 tokens, 400 by default). A writing request that asks for more reaches the protocol as a copy capped at the setting; one that asks for less keeps its own cap. The typed questions a writing model answers are capped the same way. The journal keeps the request as the consumer made it.

A stored value outside 1–120 seconds or 1–64 000 tokens (a value edited by hand) reads as the default.

A feature's model tier

A feature setting that names no provider is served by the ability's default provider, and its tier says which of that provider's models it asks for: default (the provider's model setting, else its declared default model) or stronger (the provider's strong_model when set, else the default model). A tier names no model itself, so switching the ability's provider takes every feature on a tier to the new provider's models. A setting that names a provider keeps its own model and ignores its tier.

How a feature is shown

Hryvinskyi\Llm\Api\FeaturePresentationsInterface::of() answers what the setup, settings and usage screens show about a feature. A feature declared as a virtual type of Hryvinskyi\Llm\Model\Feature\Feature declares it with optional arguments; what it leaves out falls back as shown:

Argument What it is Fallback
moduleLabel the product name (a source phrase) the module name
icon a Material Symbols name extension
description what the feature does (a source phrase) the disclosure
places the screens it is used on (an array of source phrases) none
trigger button (a person presses a button) or background (it runs on a schedule) button
typicalInputTokens, typicalOutputTokens about how many tokens a request sends and an answer uses 0, not known
resultNote what happens to an answer (a source phrase) empty
tryRoute, tryLabel an admin route front/controller/action and its phrase, both or neither no link
sample an implementation of Hryvinskyi\Llm\Api\FeatureSampleInterface built over the module's real request builder no sample

An icon, a route or a token count that breaks its rule fails when the feature is built. Nothing is translated by the reader: the admin layer that prints a phrase translates it.

<virtualType name="Vendor\Module\Model\Feature\DescribeCookie" type="Hryvinskyi\Llm\Model\Feature\Feature">
    <arguments>
        <argument name="key" xsi:type="string">vendor_describe_cookie</argument>
        <!-- label, ability, moduleName, disclosure, ... -->
        <argument name="icon" xsi:type="string">auto_awesome</argument>
        <argument name="places" xsi:type="array">
            <item name="form" xsi:type="string">Cookie form</item>
        </argument>
        <argument name="typicalInputTokens" xsi:type="number">180</argument>
        <argument name="typicalOutputTokens" xsi:type="number">60</argument>
        <argument name="sample" xsi:type="object">Vendor\Module\Model\DescribeCookieSample</argument>
    </arguments>
</virtualType>

A feature's state, and a refused key

A consumer that shows a button backed by a model asks Hryvinskyi\Llm\Api\FeatureStateReaderInterface::of() why the button cannot run. The state is decided by the checks a call runs, in the order it runs them, and the first one that stops the call wins:

State What stops the call Moment
available nothing
module_off the AI module is switched off
feature_off the feature is switched off
not_configured no provider, model or key can serve the feature
key_refused the provider refused the stored key on a call getSince(): the first refusal, UTC
budget_paused the month's money budget is used up (priced calls only) getUntil(): the 1st of next month, 00:00 UTC
daily_limit_reached the feature spent its daily attempts getUntil(): the next midnight, UTC

The state never names the provider: a consumer words it with phrases of its own ("Not set up", "Not available", "Paused until 1 April", "Try again tomorrow") and links to the setup for details. FeatureAvailabilityInterface::refusalFor() gives the same answer as an outcome, and a call that is stopped ends with the same outcome and reason (Api\Data\CoreReasonInterface): off with module_off or feature_off, not_configured with credential_refused for a refused key, over_budget with monthly_budget or daily_limit.

A refused key pauses its provider. A call (never a connection test) that ends failed with the reason unauthorized marks its provider refused, from that moment; a later refusal keeps the first moment. From then on no feature served by that provider sends anything: the call ends not_configured · credential_refused, and the provider's status answers the refusal credential_refused. The pause ends when a key is saved for the provider (through the configuration save, not the obscured value), when a connection test with the saved key passes, or when a call to the provider is answered. A connection test is never paused, so a key that comes from deployment configuration is retested from the setup wizard's Connect step.

Prices: catalogue first, then manual prices

Whether a call is priced is asked of Hryvinskyi\Llm\Api\ModelPricesInterface::priceOf() alone: the provider's catalogue (the exact id or a declared alias) first, then the merchant's manual prices (the exact id), else the call is unpriced. The answer carries where the price comes from (catalogue with the catalogue's date, or manual). The catalogue always wins: a manual price stored for a model the catalogue prices later is ignored.

A writing provider's module declares the manual prices field in its group, with this module's frontend and backend models:

<field id="manual_prices" translate="label" sortOrder="60" showInDefault="1">
    <label>Prices of other models</label>
    <frontend_model>Hryvinskyi\Llm\Block\Adminhtml\Form\Field\ManualPrices</frontend_model>
    <backend_model>Hryvinskyi\Llm\Model\Config\Backend\ManualPrices</backend_model>
</field>

Each row is a model id with its input and output price in US dollars per million tokens. A save is refused, naming the row, when a model id is not a model name, a price is not a decimal of up to three decimals or is above 10 000, one price is given without the other, a model id is given twice, there are more than 20 rows, or the catalogue already prices the model or one of its aliases. Empty rows are dropped. A stored row that breaks a rule (a value edited by hand) is ignored when prices are read, and logged once per request.

The Usage page

System › AI Models › Usage (hryvinskyi_llm/usage/index) shows what the connection costs and what it was asked: the connection, this month's budget and facts, a table by feature, the latest requests with what was sent and what came back, and the cost per day. It is a Preact island of the admin page host (Hryvinskyi_AdminUi): the page's configuration holds only the endpoints' addresses, whether the user may switch features, the setup wizard's address and the page's words in the reader's language; the island asks the endpoints for everything else.

Who may do what:

  • View AI usage (Hryvinskyi_Llm::usage) opens the page and its three read endpoints, the texts of a request included. Those texts hold store data, never a credential: the journal redacts them.
  • Set up AI Models (Hryvinskyi_Llm::setup) is needed besides to switch a feature on or off from the page; without it the page shows each feature's state instead of a switch, and no link into the setup wizard.

The endpoints (hryvinskyi_llm/usage/*) answer JSON with Cache-Control: no-store, a refused request with 400 {"error": reason}; they take no free-form query:

  • summary?month=YYYY-MM — the current UTC month or one of the twelve before it (month): the connection (the writing provider's name and icon, whether a call could be built, since when it refused its key, its newest request), the budget (spent, budget, policy, share, reset moment, pace, the calls without a price, and where the price of the writing provider's default model comes from: catalogue with its date, manual, or none — then the budget is inactive, since a call without a price is neither counted nor stopped by it), the facts, the one reason the attention strip shows (budget_used_up, key_refused, budget_80 or none, the first rule that applies by priority), each feature's line with its state, each day's cost, what the journal keeps, and where a feature can be tried.
  • calls?filter=all|failed&feature=<key>&before=<id>&size=<1–50> — a page of the log, newest first, by keyset, with this month's counts for the two filters. A row never holds the texts.
  • call?id=<id> — one request with its texts, its facts worded, who asked (a role: "asked by an admin", "the background run", "a console command"), the feature's own result note and disclosure; 404 {"error": "not_found"} when the journal does not hold it.
  • feature (POST, {"key": text, "enabled": bool}, setup rule) — switches the feature, keeping its pinned provider, model, tier and daily limit, and answers its state. Safe to repeat.

A request that was not answered is worded from its reason code alone, never from what the provider wrote and never with a status number: rate_limited reads "Asked to slow down", unauthorized "Key refused", timeout "No answer", a code the module does not know "Failed". A protocol module words a code only it ends a call with by adding a source phrase under that code to the phrases argument of Hryvinskyi\Llm\Model\Usage\Answer\ReasonWording.

The island is built from frontend/usage/ (npm ci, npm run check, npm test, npm run build; npm run verify-build checks that the committed view/adminhtml/web/js/usage/usage.js matches its sources). It imports only the UI library and the admin UI kit, through the host's import map. Amounts arrive as whole billionths of a dollar and are shown without a float: four decimals below a cent, dollars and cents above. A feature's switch shows the new setting only once the server has answered; every text a request sent or got back is printed as text.

Privacy: what the journal keeps

Every call that gets as far as a provider is a journal line: the feature, the provider and model, the tokens, the cost and where its price came from, how long it took and how it ended, who asked and what it was about.

  • Texts are kept by default for 90 days: the request a feature sends and the model's answer, so a wrong answer can be looked into (Stores › Configuration › Hryvinskyi Extensions › AI Models › Call journal). For a call that was not answered nothing that came back is kept. Texts are emptied once a day when they are older than their days, and never outlive their line (retention_days). A merchant who switches texts off or stores other days keeps that setting.

  • Every text, the subject and the reason pass the redactor: a stored API key is never written to the journal, and never shown.

  • Who asked is read by the core, never handed in by a consumer: admin with the admin user's id for an admin request, cron for a cron run, cli for a console command, nothing otherwise.

  • What a call was about is the consumer's own label, passed as a context:

    $result = $this->textWriter->write(
        'my_feature',
        $request,
        $this->callContexts->create('Banner message · en → de') // Api\CallContextFactoryInterface
    );

    The subject is cleaned, never refused: one line of at most 120 characters, without control characters. It is stored as text and printed escaped.

  • A consumer is responsible for what it sends. The journal keeps what was sent, so a feature sends no personal data it does not need, and its disclosure says what it sends.

The month's figures on the usage page (requests, failures, tokens, cost per feature and per day) come from a daily count kept for 400 days, not from the journal: a journal kept for a single day still leaves the month whole. The month's spend is the money budget's own figure.

Translations

The admin wording ships in en_US and 25 more locales: the official languages of the European Union, Norwegian Bokmål and Ukrainian. The translations are machine-made; have them read by a native speaker before a store relies on them.

Tests

  • Unit: vendor/bin/phpunit -c app/code/Hryvinskyi/Llm/phpunit.xml.dist; the transport's tests run against a real server on loopback.
  • Integration: the platform's harness in dev/tests/integration.
  • Browser workspaces: frontend/ai-wizard/ and frontend/usage/ (npm run check, npm test, npm run build, npm run verify-build).
  • Browser flows: Test/E2e/, run with the @hryvinskyi/magento2-e2e package from the shop's e2e/ directory; the admin flows need an admin account for the package.