okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221integrations/harness: the Strata profile and the agent bridge090e45adf

main
3.8 KiB66 linesraw
1# The Strata profile: DeepSeek Harness as the agent backend for a *local* model.
2#
3# This is a patch layer over the shipped base + web-app bundles (see package.json). It does two
4# things and nothing else:
5#
6#   1. points the agent's model at `strata-local`, the Strata API worker on loopback;
7#   2. declares that route to the pi-ai adapter as an ordinary OpenAI-completions endpoint with
8#      explicit capabilities.
9#
10# It deliberately does NOT inherit the shipped web profile's `deepseek-official` default. Local use
11# must not require a DeepSeek account and must never silently fall back to a cloud model, so the
12# default model here is the local one and no cloud route is declared.
13- id: agent-default-model
14  name: "@deepseek-ai/dsh-agent-default-model"
15  config:
16    provider: strata-local
17    model: qwen3.8-flash-next
18
19- id: llm-pi-ai
20  name: "@deepseek-ai/dsh-llm-pi-ai"
21  # NOTE: the schema is `{ providers: { "<route>": <profile> } }` — a dict *keyed by route* under
22  # `providers`, not route keys at the top level. A top-level route key is silently ignored and the
23  # adapter then never registers, which surfaces much later as
24  # `no adapter registered for provider "<route>"`.
25  config:
26    providers:
27      strata-local:
28        displayName: Strata (local)
29        # An OpenAI-compatible dialect. `supportedProtocols()` in llm-pi-ai is
30        # openai-completions | openai-responses | anthropic-messages; the Strata worker implements
31        # the documented subsets of all three, and chat completions is the one exercised here.
32        api: openai-completions
33        baseURL: http://127.0.0.1:8095/v1
34        # The Strata worker does not require a key on loopback, but pi-ai's OpenAI-compatible
35        # client insists on one before it will send a request at all. Two things were tried and
36        # both fail before reaching the worker, which is worth recording:
37        #   * `apiKeyEnv: <NAME>` with the variable unset -> `no credential for provider route`
38        #   * naming no credential at all               -> `No API key for provider` (PI_AI_ERROR)
39        # A literal placeholder satisfies the client. It is NOT a secret, must never be treated as
40        # one, and is scoped to loopback by baseURL. If the worker is started with `--api-key`,
41        # this must become an `apiKeyEnv` credential reference instead.
42        headers:
43          Authorization: "Bearer strata-local"
44        compat:
45          # The worker's Chat Completions implementation is plain OpenAI; disable the provider
46          # conveniences pi-ai would otherwise assume.
47          supportsStore: false
48        models:
49          - id: qwen3.8-flash-next
50            name: Qwen3.8-Flash-Next (local)
51            # These are the *actual* limits the selected local profile reports, not catalog
52            # defaults. Setup recommends 32K below 96 GB unified memory and measures to 32K; see
53            # docs/MAC.md. Over-claiming here would let the agent build a request the engine
54            # refuses mid-turn.
55            contextWindow: 32768
56            # Sized against the *whole* request, not just the visible prompt: the Harness system
57            # prompt plus its tool definitions is already ~29K tokens of the 32K window, so an 8K
58            # output budget makes every turn fail with the worker's
59            # "request exceeds the context window ... requests are never truncated".
60            # The worker will not silently shrink a request, which is correct; the route must
61            # declare a budget that fits. The real-machine profile should either raise the engine's
62            # context (docs/MAC.md measures to 32K, and the model supports more) or set the engine
63            # config's `fit_max_tokens` so the server trims with a label rather than refusing.
64            maxTokens: 2048
65            input:
66              - text