McBasic™Get McBasic™ ↗
Build 881
Practical guide

Set up LM Studio locally

Connect the local Responses API, select a loaded model and keep request budgets and sharing explicit.

Connect an existing local server#

  1. Install and open LM Studio separately. Load a suitable chat model and start its local server. McBasic™ does not download a model or launch that server for you.
  2. Open AI Settings and choose LM Studio (local). The default Responses endpoint is http://localhost:1234/v1/responses. Keep an explicit port and a loopback HTTP address.
  3. List the available models and select the model you loaded. If the server exposes capabilities, check its tool-use support; a listed model is not proof that every generation operation works.
  4. If your local server requires an API key, enter it; otherwise leave the optional key empty. Save and verify the success message. A validation or Keychain failure must not be mistaken for a successful Save.
  5. Open a disposable project, choose Ask, review the chips and Show exact content, then send a small question. Only proceed to edits after that works.

Fit the request to the loaded model#

Local requests are capped at 120,000 UTF-16 code units: nominally 20,000 prompt and 100,000 context. A 60,000 preset lowers those to 10,000 and 50,000. Automatic or a larger preset does not raise the local cap. The model you loaded may have a smaller usable window; reduce context or select a suitable smaller request.

Unused context allowance can be borrowed by the assembled prompt while the combined total stays within budget. A source chip is not proof it was sent: inspect the exact-content view and omitted-context notices. See the worked budget examples.

Use the same review boundaries#

LM Studio uses the Responses transport and documentation lookup tools. It must implement that API, not just a chat-completions route. Ask/Explain remain read-only; Build/Fix and approved plans can propose changes under the selected apply policy. Prefer Ask me first while learning, inspect complete diffs and run the resulting app.

AI styling guidance and nonblocking layout/code advisories can improve a proposal, but are not proof that controls fit or behavior is correct. Project maps can be reduced in detail to fit budgets; plans retain the current stage context and earlier decisions. Review the actual selected content before sharing private source.

Diagnose the server, not the BASIC code#

FailureNext check
Connection refusedConfirm the server is running at the configured host and port.
401 / 403Correct the local API key, or clear it if the server does not require one.
404Read the returned message: a missing Responses route differs from an unknown model.
No models loadedLoad the selected model in LM Studio and retry.
MCB4702 / request too largeReduce the request or context; increasing a preset above the local cap cannot help.

Loopback mode rejects remote hosts, redirects, credentials in the URL, query strings and fragments. Remote Responses-compatible providers are a separate configuration; they have their own endpoint, retention and costs.

Source baseline 20f4bfed6b · Build manifest
Sources & maintenance

Original web explanation, reviewed against these repository sources. API tables and example files follow the implementation.

  • src/McBasic.Build/LmStudio.cs
  • src/McBasic.Build/AiProvider.cs
  • macos/McBasicIDE/Sources/AIRequestBudget.swift
  • macos/McBasicIDE/Sources/AIProviderController.swift