Use LM Studio with Codex from the terminal
Use the Mandri CLI to connect Codex to a model served by LM Studio on the same computer.
Start the LM Studio server
Section titled “Start the LM Studio server”Download and load a model that fits your computer’s memory. Choose a model with native tool use support for coding tasks.
In LM Studio’s Developer tab, select Start server. Note its address and port, then keep it running. The default address below assumes port 1234. See the LM Studio server documentation for its controls.
Register the local server
Section titled “Register the local server”If server authentication is disabled, run:
mandri provider add lmstudio --kind lm_studio --base "http://localhost:1234" --key "lm-studio"The current CLI requires a nonempty key even for a server without authentication. Here, lm-studio is a placeholder, not a credential. If your server requires authentication, omit --key and enter its actual key at the interactive prompt:
mandri provider add lmstudio --kind lm_studio --base "http://localhost:1234"Use the address shown by your server if you changed its port. localhost refers to the computer running Mandri’s local service.
Choose the model and launch Codex
Section titled “Choose the model and launch Codex”mandri provider models lmstudioCopy the exact model ID, then replace <model-id> below. Run the command from your project folder:
mandri run --model "lmstudio/<model-id>" codexCodex is included with Mandri. Enter your request in its terminal interface and review its actions and file changes.
The local model handles model requests for this session. The agent may still use other services or commands during a task. A local model alone does not make every action offline.
If setup fails
Section titled “If setup fails”The server cannot be reached: check that LM Studio is running, the server is enabled and the port matches the command.
The model replies but cannot perform actions: check its tool use support. Memory, context and speed depend on the model and its settings.
For the graphical interface, see LM Studio in the app.