Griptape Prompt Driver: LM Studio
Your local models, OpenAI-style — LM Studio as a Griptape brain
- DRIVER
LM Studio is the friendly-face local model runner - a desktop app that downloads GGUF models, serves them on a localhost endpoint that speaks OpenAI's API, and lets you click around instead of typing commands. This driver points a Griptape agent at that endpoint, which is the whole local-model story for people who find Ollama's CLI intimidating. Everything stays on your machine: no API keys, no data leaving your box, no per-token bills.
There's a catch worth knowing up front: the model runs on your hardware while ComfyUI is also trying to use your GPU for diffusion. Local LLMs and image generation fight over the same VRAM. LM Studio handles this better than most (you can offload to CPU/RAM), but don't expect a 70B model and SDXL to coexist happily on one card.
How it works
LM Studio exposes an OpenAI-compatible API on http://127.0.0.1:1234 by default. The node builds a Griptape LMStudioChatPromptDriver pointed at that URL - the defaults (base_url http://127.0.0.1, port 1234, api_key lm_studio) match LM Studio's out-of-the-box settings, including the dummy API key LM Studio accepts so OpenAI-style clients don't choke. Fire up the local server in LM Studio, load a model, and the driver just works.
The inputs that matter
model- free-text. LM Studio doesn't strictly need it, but it's used to identify the model, so set it to what you loaded (e.g.llama-3.1-8b-instruct) so your workflow reads clearly.base_urlandport- default tohttp://127.0.0.1and1234. Change them only if you've reconfigured LM Studio's server.api_key- defaultlm_studio(LM Studio's placeholder). Leave it; the field exists because the OpenAI client requires a key string.use_native_tools- note this one defaults to false here, unlike most other drivers. Local models' native tool support is spotty; leave it off unless you know your model handles function calling.response_format-defaultorjson_object;json_objectonly works if the loaded model supports it.
Standard temperature, seed, min_p, max_tokens, max_attempts_on_fail included. Output: DRIVER.
LM Studio vs Ollama
Both drivers do the same job with local models. Ollama is lighter, scriptable, and the README's featured local path. LM Studio has a GUI, per-model settings, and is gentler to configure. If you're a beginner who's intimidated by ollama run llama3, LM Studio is the friendlier on-ramp; if you're already in the Ollama habit, there's no reason to switch.
Installing it
Install the pack, then install LM Studio from lmstudio.ai, load a model, and click "Start Server" in the app. Pack install: ComfyUI Manager → Griptape → ComfyUI-Griptape, restart, or git clone https://github.com/griptape-ai/ComfyUI-Griptape into custom_nodes. No API keys to configure - the whole point.
Common issues
If the agent can't reach LM Studio, it's almost always "server not running" - the localhost:1234 endpoint only exists while the app's server toggle is on. Watch VRAM too: if ComfyUI starts OOMing after you add a local LLM, you're double-booking your GPU. And the pack-wide torch/griptape-version issues apply as usual - reinstall torch with the cu121 wheels if ComfyUI breaks, python -m pip install griptape -U if you see import errors.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| modelopt | STRING | The model to use for the chat prompt. | |
| max_attempts_on_failopt | INT | 21–100 | Maximum attempts on failure |
| temperatureopt | FLOAT | 0.100–1 | Temperature for sampling |
| seedopt | INT | 10342349342 | Seed for random number generation |
| use_native_toolsopt | BOOLEAN | false | Whether to use native tools. |
| max_tokensopt | INT | -1 | Maximum tokens to generate. If <=0, it will use the default based on the tokenizer. |
| min_popt | FLOAT | 0.100–1 | Minimum probability for sampling. Lower values will be more random. |
| response_formatopt | COMBO | default | Format of the response |
| base_urlopt | STRING | http://127.0.0.1 | The base URL for the API. |
| portopt | STRING | 1234 | The port to connect to the API. |
| api_keyopt | STRING | lm_studio | API key for authentication. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DRIVER | PROMPT_DRIVER | — |