Skip to content

Local models with Ollama or LM Studio

In short

  • Codex can run on Ollama or LM Studio, and Claude Code on Ollama, on a model served on your own machine. Gemini CLI and Cursor cannot.
  • Set it per profile: Settings → Profiles, then Model provider → Ollama (local).
  • No cloud login or API key is needed. The agent CLI must still be installed.
  • A small local model may not cope with a full workflow. Test it on a short task first.

Codex and Claude Code can run ParleML skills using a model served on your own machine. The CLI still supplies the agent loop and tools; Ollama or LM Studio supplies inference. Installing Ollama does not install a model.

Agent Provider Default server URL Inference API
Codex Ollama http://localhost:11434 Responses
Codex LM Studio http://localhost:1234 Responses
Claude Code Ollama http://localhost:11434 Anthropic Messages

Use current provider software that supports the required API and a model with tool calling. Gemini CLI and the Cursor SDK do not expose a local provider in ParleML. These settings configure the agent's language model, separately from the statistical models trained by ML4 and the embedding models in System.

Configure a profile

  1. Install the selected agent CLI on the ParleML server. Start Ollama or the LM Studio server and install a suitable model using that application's UI/CLI.
  2. Open Settings → Profiles, duplicate a suitable profile, and open Runtime → agents, caps & skill pins.
  3. Select Codex or Claude Code, then Model provider → Ollama (local). Codex also offers LM Studio (local).
  4. Enter Local server URL, or leave it empty for the default. The URL is reached by the backend, not your browser. If ParleML runs in a container or on another computer, localhost refers to that environment. Use an address the backend can reach. 127.0.0.1 can help when localhost resolves to the wrong loopback interface.
  5. Click Check server and list models, then choose or type Local model. Discovery only reads the server's model inventory; it does not download, load, or run a model. Ollama entries advertised as cloud models are excluded.
  6. Save and run the profile's Preflight. Assign the profile from the workspace's Agent profile menu, then start a new session.

No subscription login, API key, codex login, or claude /login is required for local inference. No changes to your personal CLI configuration are needed. Personal CLI settings are excluded in local mode so they cannot redirect the selected provider. Pack-owned rules, granted tools and ParleML's session permissions still apply.

Settings → Agents shows installation-level cloud login status. A missing cloud login there does not block a local profile: its preflight and the workspace agent picker check its local provider instead.

Model tiers, pins and recovery

All tiers use the profile's local model unless a Tier model override names another local model. This avoids sending cloud names such as opus to Ollama. Leave cloud-specific effort/thinking controls unset unless your model supports them. Local tier editors do not offer those controls.

Per-skill pins can override the provider, endpoint and model. Changing an agent or provider clears incompatible inherited model choices. A person selecting a different agent at session start uses that agent's default provider; to offer a second local configuration, create another profile. Review pins and allowed agents if the entire workflow must use local inference.

Child steps inherit the resolved configuration. Running sessions retain their configuration, but resuming a run reloads its profile's current configuration. Keep the provider and model unchanged when continuing a local conversation; start a new session when switching providers. One-shot annotations also use its local provider and never automatically fall back to a cloud agent. Explicit cloud pins and external MCP connections remain possible; local inference alone does not make every tool offline.

What readiness verifies

Preflight verifies the agent CLI, the local server's inventory endpoint, the selected model, and explicit local tier/pin models. It reports missing models or an unreachable server instead of asking for a cloud login. Install/load the model in its provider, check again, then retry the session.

An inventory check does not prove that the model can fit in memory, handle the skill's context, call tools correctly, or produce schema-valid output. Validate with a small real task before attempting a full workflow. A successful short chat also does not prove that a long agent session will succeed.

A laptop without a suitable GPU

Use Steps at once = 1, one model for all tiers, a small quantized model and a short task. Close memory-heavy applications before inference and avoid training ML models concurrently. Download size is smaller than total runtime memory: weights, context and the agent/backend all consume RAM.

Ollama's agent guides recommend a context window of at least 64k. Increasing context increases memory use. A small model with a short context is useful for a connectivity experiment, but may not handle ParleML's full tool descriptions and skill instructions. Do not enable a large context blindly on a 16 GB, CPU-only laptop. A stronger machine serving Ollama on your network is an option; set its address in the profile.

See Try a local agent on a modest laptop for a cautious first exercise, including how to unload the model afterwards.

Account apps and context isolation

In Settings → Profiles → your profile → Advanced · connections & host assets, under Host assets, leave Include account apps (Codex and Claude Code) off unless the session needs apps connected to the account running the backend. This opt-in is independent of Include my own settings and applies to cloud and local sessions. It is off by default. It does not disconnect apps or change your personal CLI configuration.

ParleML keeps the full skill and briefing prompts, configured MCP connections, tool grants, built-ins, pack rules and enabled hooks. It also keeps the normal CLI home, saved login and conversation IDs. Automatic account-app discovery is disabled: Codex receives --disable apps; Claude receives ENABLE_CLAUDEAI_MCP_SERVERS=false and disableClaudeAiConnectors: true, alongside its existing strict MCP configuration. Tool-free annotation calls always exclude account apps, even when the profile opts in.

Enable the switch to permit account-app discovery. The CLI's login, provider, permission rules and account policies still decide which apps can actually be used; this is not a blanket tool permission grant. Claude local providers use a separate authentication source and may not load claude.ai connectors. Prefer a profile-configured MCP connection for a tool a local workflow requires. The switch does not control Gemini or Cursor.

This avoids unrelated app tool definitions consuming context. It does not shorten ParleML prompts or remove the host's core instructions, skill catalog or configured tools. A small model can still run out of context or fail to use tools correctly. Start a new run to test isolation: a resumed conversation can retain previous context. Children inherit the choice and snapshots record it. As with other settings, resuming reloads the original profile's current values.

host_assets:
  include_account_apps: false # default; opt in explicitly when needed

See the upstream Codex feature configuration and Claude connector controls.

Configuration reference

The UI saves this agent block in the profile:

agent:
  adapter: claude-cli # or codex-cli
  provider:
    kind: ollama # lmstudio is supported by codex-cli only
    endpoint: http://127.0.0.1:11434
  model: qwen3:1.7b # example for a small smoke test, not a full-workflow recommendation
  max_concurrent_children: 1
  max_turns: 4
  wall_clock_seconds: 180

Omit provider to retain existing cloud/login behavior. A pin can explicitly set provider: {kind: default} to return to that behavior. URLs must be HTTP(S), without credentials, query parameters or extra paths; an optional /v1 suffix is normalized. Provider credentials are not stored in profiles.

The admin-only POST /api/agent/admin/local-models accepts the provider object and returns ok, detail and models. It does not start inference. Codex uses an explicit Responses provider rather than an automatic model-pulling command; Claude receives an explicit endpoint and local model aliases for the attempt.

Upstream references: Codex with Ollama, Claude Code with Ollama, Ollama context length.

Next