strata-endpoint

Public

Connect LM Studio to Strata with image input, streamed reasoning, tool calling, automatic history archiving and retrieval, and research loop limits.

165 Downloads

README

English | 日本語 | 简体中文 | 한국어 | Español

Strata Endpoint for LM Studio

Version 0.3.5

A beta native LM Studio generator for a separately running Strata server. It forwards chat images, streams server-provided reasoning, bridges tools, and archives search history locally to manage the request budget. This plugin version is independent of the Strata engine/Terminal version. Automatic semantic summaries and cross-chat long-term memory are not implemented.

Changelog

Installation

Install yuanjumay/strata-endpoint from LM Studio Hub, then select it as the chat’s generator. Start Strata separately. This is distinct from sonct/openai-compat-endpoint and the old local/strata-endpoint; select the correct generator and review settings in existing chats.

Quick start

  • Start Strata and set Strata Base URL, Model and Context window to match the running server.
  • Select yuanjumay/strata-endpoint as the chat generator. Enable only the external tools needed for the task; document search requires File Search tools.
  • Send a text request to check the connection, then add images or document attachments as needed. If the image button is missing, follow Image button helper or use the documented @strata-image command.

Settings

SettingDefault
Strata Base URLhttp://127.0.0.1:8080/v1
API Key (optional)""
Modelstrata
ThinkingServer default
Max output tokens0
Thinking token budget0
Context window131072
Answer space16384
Research call limit64 (8–256)

Base URL accepts the server root, /v1, or the full chat-completions endpoint. Set Context window to the server’s actual limit. Max output tokens includes thinking. At 0 it uses Answer space, raised to at least Thinking token budget + 2,048 when an explicit thinking budget is supplied. Thinking budget 0 uses the server default. LM Studio’s local-model Temperature and similar sampling settings are not forwarded; sampling and ESP remain server-side settings.

Staged Web coordinator

Enable Visit Website Advanced (or Visit Website) and Read Saved Website; Search Saved Website is used for further searches when enabled. Send a bare HTTP(S) URL or an explicit request such as “Read this URL: https://example.com”. Known direct-reading phrases are recognized conservatively; ambiguous requests keep legacy routing. Explicit no-access instructions and fenced URL examples are not automatically fetched. Up to 8 URLs per request; an oversized batch fails before fetching rather than silently dropping links.

Remove the hidden 4,096-token final-answer cap from both legacy and staged Web paths. Stopping research now retains the normal output budget: explicit maxTokens, or answerReserve when maxTokens=0, subject to the existing bounded automatic reservation adjustment. Input is still fitted with output space and safety reserved; if pinned input cannot fit, fail instead of silently taking output space. Log server finish_reason=length as incomplete without appending text to JSON/code or automatically regenerating it. SDK GeneratorController has no separate status/finish-reason UI API, so this is a log diagnostic, not a new UI warning.

Recognize optional File Save 0.2.0 ZIP tools in the staged Web runtime, including after source reading ends. Normal host dispatch, schema validation and the separate current-turn File Save limit remain in force.

Keep enabled File Save tools available after staged Web acquisition and after source reading ends. Saving still uses normal host tool dispatch and exact schemas; reading limits do not silently disable export. File Save calls have a separate current-turn limit of 256; partial sessions persist for continuation. File Save is optional.

Expose Read Saved JSON-LD in the staged Web runtime with the same conversation-scoped pageId validation and current-turn call accounting. Requires Visit Website Advanced 1.4.3 for that optional tool.

Exclude Analyze Images automatic-attachment inventories from Web intent and URL extraction. Image source URLs are context metadata, not extra pages to fetch. Preserve the full attachment metadata and images in model input; explicitly requested image URLs remain explicit targets.

Acquisition and initial source reads are requested through LM Studio’s normal tool lifecycle, without direct provider calls or bypassing host permissions. No user-supplied pageId is needed to open a URL. A failed/pending tool result, unknown scoped reference, missing tool and context shortage are distinct states. Known nonempty compact pages receive an initial block-0 read; outlines are followed by a source-block read when needed. The first block is not complete page coverage or necessarily the most relevant passage. The model can request other blocks/offsets/searches; citation accuracy remains model-dependent.

The Web path sends only Web/archive tool schemas, keeping original schema constraints. Optional old text is stored once as a scoped archive and a bounded recent-dialogue packet; current input and every previously included image/identity remain pinned. It does not implement semantic long-term memory or automatic image selection. Each invocation permits at most 8 model attempts, including at most 2 explicit context-overflow retries; failed output gets one recovery. The final answer disables thinking and retains the normal configured output budget. Current-turn Web tool results count toward Research call limit. Three consecutive identical read-only results finish the source-reading phase. Insufficient pinned capacity is reported before an incapable model-only answer.

Scope and rollback: non-Web requests, ambiguous reading intents, attached document combinations, image download/analysis combinations and unsupported intents still use the legacy coordinator. Saved-page follow-ups require an explicit known pageId or an unambiguous immediately preceding page task; no other chat/global latest page is substituted. Set process environment LMSTUDIO_STRATA_RUNTIME=legacy before starting LM Studio to restore legacy routing, then restart; unset it to restore staged routing. Storage paths, public ID and configuration keys are unchanged. Tests cover actual Visit parsing/storage and synthetic 16-image history. Real Strata tests use only a local fixture page; host scheduling/approval is emulated, not UI-verified.

Images and direct inspection

Readable user images are sent as actual image bytes, labeled with byte-derived SHA-256, original name and request-local message/image positions. The main model is guided to inspect them directly before delegating; analysis tools remain allowed for saved local images or rechecks. Filenames and inventory order are not evidence of image content. Analyze Images Advanced’s attachment verification gate is preserved. JPEG, PNG, GIF, WebP, BMP, TIFF and AVIF are forwarded subject to server support; limits are 20 MiB per image and 64 MiB across the conversation.

Expired SDK attachments can be recovered from this plugin’s working-directory-scoped snapshots if available. A missing current image stops generation and requests reattachment; an older unavailable image is marked unavailable rather than treated as inspected. The plugin does not search arbitrary uploads by filename.

Image button helper

The image button uses an experimental compatibility helper: pre-download SmolVLM-256M-Instruct Q8_0 (about 365 MB including adapter). The plugin does not download it automatically. It reuses a loaded helper or loads one on CPU with context 512; it never runs inference on that helper. Images and questions go to Strata. The workaround backs up eligible native chat metadata before setting missing lastUsedModel; it does not overwrite an existing model choice. Interface behavior may vary with LM Studio.

lms get https://huggingface.co/ggml-org/SmolVLM-256M-Instruct-GGUF --gguf --yes

If the button is unavailable, use a separate line @strata-image "<absolute local image path>". This reads and attaches that local file. When combining with Analyze Images Advanced, use the current version and configure its separate Strata endpoint too; the helper is not the analysis backend.

Documents and tool compatibility

With File Search tools enabled, unprocessed text/JSON/HTML attachments in the history are imported before generation, including Insert-only sequences. The bundled importer uses the same storage and encoding rules as File Search without reading another plugin’s installation. Enable File Search to expose list/search/read tools. PDF/Office are unsupported. See the File Search guide for JSON/HTML references and @file-encoding overrides.

Native tool calls and complete recoverable XML calls are schema-checked before dispatch. Compatibility repairs are deliberately limited: explicit true/false strings for recursive in List/Search Local Images; a valid JSON-array string for Multi Analyze imageNames; string annotation extras collectionId_note/collectionId-alias only when a valid collectionId already exists; and positive safe-integer read_json childLimit values above the declared 50 reduced to 50. Full schema validation still applies. IDs, pointers and page offsets are not guessed or changed. Logs show types/normalization fields, not private query values.

Support File Search short tool names and legacy history aliases; preserve ingestion, argument normalization and research limits. Count AI reading as research, stop repeated identical AI ranges, and do not replay AI results as immutable keyword results.

Context budget and archive retrieval

The following policies describe the legacy path. Explicit Web requests use the staged coordinator above with its own capability-preserving budget and attempt rules.

Before every request, including tool rounds before the first answer, the generator estimates text, images and tool definitions, reserving output/thinking and a safety margin. Text uses roughly one token per two UTF-8 bytes and images 4,096 tokens each; this is not the server tokenizer. Oversized results (over 12,000 characters), older prose and completed research exchanges can be saved in full and replaced by short references in the outgoing copy. The native chat is unchanged. Images are not removed, reordered or resized. Saving failure stops the request.

Internal read-only tools strata_search_archive (case-sensitive literal keyword, up to 5 hits) and strata_read_archive (UTF-16 offset, up to 6,000 characters) retrieve archived originals without enabling another plugin. Only archive IDs admitted for the current request are available; there is no global chat search. These previews are not semantic summaries. Structured document previews retain document/post/block references and bounded omitted-hit references, but omitted content must be reread. Verify HTML quotes against the original document/post, not an earlier model answer or a conversation export.

Only explicit context-overflow HTTP 400 errors are retried, at most twice using the server’s reported counts; unrelated errors and partial answers are not replayed. Current input, system instructions, images or tool definitions can still exceed the budget even after archiving. In that case reduce the current material or enabled tools, or use a supported larger server context. Archiving is not a guarantee against every overflow and does not raise the server’s limit.

Clarify internal archive references and detect archive-only JSON replies. Withhold a detected receipt and retry the answer once with tools and thinking disabled; report failure if it repeats. Explicit user requests to inspect archived_context remain available. Original chat history is unchanged.

Recover small estimated input overflows by borrowing a bounded part of automatic output space after description compaction. One adjustment per generator invocation, at most 4,096 tokens or 25% of the current output limit, whichever is smaller, with 1,024-token headroom rounded to 256-token units. Keep at least 8,192 output tokens when the original reservation allows it and respect explicit thinking budgets plus 2,048 answer tokens. This adjustment never changes explicit Max output tokens or the context safety margin. If still too large, try the bounded tool-free answer path even with zero completed tools in the new user turn. Preserve input, images and native history; irreducible requests still fail. Regression tests include 16 images; real-model continuation was not replayed.

Present plugin-authorized archive references as historical data with archiveId and source coordinates, not archived_context JSON in assistant answers. Omit assistant head/tail/prior-answer snippets from the outgoing reference while keeping stored originals retrievable; tool source previews retain their own coordinates and call IDs. Quarantine recognizable old assistant receipt leaks without authorizing unknown IDs. Keep current user input and image identities/bytes untouched. Do not forward completed leading prefixes from prior assistant messages; native history stays intact. Budget estimation uses the presented form. Receipt-repair requests also use the read-only final-answer view. Automated tests validate formatting/retrieval, not real-model answer quality.

Research progress and loop limits

The following policies describe the legacy path. Explicit Web requests use the staged coordinator above with its own capability-preserving budget and attempt rules.

A compact ledger records recent calls, arguments, counts, continuation positions and archive references for the current user request. The two most recent current-request tool exchanges are retained until later budget-reduction stages. Successful identical File Search list/search/read requests can reuse their immutable local result within the same user request. Errors, network searches and writes are not reused. Changed IDs, query or page positions are new requests. New external executions still follow LM Studio permissions.

Research stops after 6 consecutive repeats of previously seen identical calls/results, 2 local-result reuses in one generation, the per-request Research call limit (default 64), more than 8 internal archive rounds, or inability to fit the progress record. This covers document/archive tools and recognized Brave search names. The generator makes one final tools-disabled, thinking-disabled request with the normal configured output budget. It reports a stop reason if no usable answer arrives. Limits reset for a new user request. Reaching a limit is not proof of exhaustive research; answer coverage and accuracy remain model-dependent.

Before stopping for context pressure, retry with shortened tool descriptions only; tool names, schema constraints, enum/default/example values and images stay intact. If finalization returns no answer or only tool requests, retry once with prior action requests removed and returned results labeled as read-only data. Native/ XML tool requests remain blocked. Keep useful prose without the generic stop warning. Persistent failure reports the actual stop reason and current-turn count; logs record blocked-tool and answer-character counts. Limits still reset on a new user message; recall/answer quality is not guaranteed.

Storage

Context archive: ~/.lmstudio/plugin-data/yuanjumay/strata-endpoint/context-v1/, override with LMSTUDIO_STRATA_ARCHIVE_DIR. It is independent of the prediction working directory. Entries retain full original results/messages and integrity metadata, up to 64 MiB each. They may contain confidential text, are not encrypted or automatically deleted, and remain after deleting the chat. Stop the plugin before manually removing data. This archive is distinct from File Search collections and Visit’s web-page archive.

Interface language

Setting labels, descriptions and choices automatically use the OS locale when the plugin starts. Supported editions are English, Japanese, Simplified Chinese, Korean and Spanish; unsupported locales fall back to English. Traditional Chinese locales currently fall back to English. Detection uses Node’s default Intl locale, with locale environment variables only as a fallback if that is unavailable. This follows the OS/runtime environment, not a language selected separately inside LM Studio. Tool names, parameter keys, stored values and model-facing tool schemas stay unchanged.

There is no language selector in the UI. For an override, edit the shared file ~/.lmstudio/plugin-data/yuanjumay/ui-language.json, created with auto on first startup when writable. Use auto, en, ja, zh-CN, ko or es. The same file controls Analyze Images Advanced, Visit Website Advanced, Strata Endpoint, File Search and File Save. Restart the affected plugins or LM Studio after editing. Missing/unreadable/invalid preferences do not prevent startup; automatic detection is used. Datetime Advanced currently has no custom configuration panel to translate.

{
  "language": "auto"
}

Guide text may refer to English setting names; translated tables also show those names for reference. The LM Studio application’s own controls follow its own localization. Only setting display text is localized here, not model-facing prompts or tool results.

Development and validation

From a local checkout, run the following in this plugin’s directory. Development files and tests are available in the source checkout, not necessarily in the Hub download.

npm ci --ignore-scripts
npm run build
lms dev --install
npm run check
npm test

Automated tests check data handling and requests using substitute model responses. They do not establish a real model’s recognition accuracy, search decisions or answer quality.

Build/check bundle the shared File Search importer from the repository source; use the full development checkout. Automatic title generation uses a separate bounded text-only request and a fallback title when it times out, without rerunning the main answer. Only server-exposed reasoning_content is displayed as thinking; this does not request access to hidden internal reasoning.

Credits and license

Plugin development: Yuan Jumay. Strata is a separate project: Niko1221/Strata. LM Studio SDK, bundled libraries and helper models retain their own licenses. This plugin does not distribute Strata model weights.