Nodes/ComfyUI Griptape Nodes/Griptape Prompt Driver: LM Studio
ComfyUI Node

Griptape Prompt Driver: LM Studio

Your local models, OpenAI-style — LM Studio as a Griptape brain

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Prompt Driver: LM Studio
    • DRIVER
    model
    max_attempts_on_fail2
    temperature0.10
    seed10342349342
    use_native_toolsfalse
    max_tokens-1
    min_p0.10
    response_formatdefault
    base_urlhttp://127.0.0.1
    port1234
    api_keylm_studio

    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_url and port - default to http://127.0.0.1 and 1234. Change them only if you've reconfigured LM Studio's server.
    • api_key - default lm_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 - default or json_object; json_object only 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 → GriptapeComfyUI-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.

    CategoryGriptape/Agent Drivers/Prompt

    Inputs (11)

    NameTypeDefaultDescription
    modeloptSTRINGThe model to use for the chat prompt.
    max_attempts_on_failoptINT21–100Maximum attempts on failure
    temperatureoptFLOAT0.100–1Temperature for sampling
    seedoptINT10342349342Seed for random number generation
    use_native_toolsoptBOOLEANfalseWhether to use native tools.
    max_tokensoptINT-1Maximum tokens to generate. If <=0, it will use the default based on the tokenizer.
    min_poptFLOAT0.100–1Minimum probability for sampling. Lower values will be more random.
    response_formatoptCOMBOdefaultFormat of the response
    base_urloptSTRINGhttp://127.0.0.1The base URL for the API.
    portoptSTRING1234The port to connect to the API.
    api_keyoptSTRINGlm_studioAPI key for authentication.

    Outputs (1)

    NameTypeDescription
    DRIVERPROMPT_DRIVER