Griptape Util: Create Agent Modelfile
Bake your agent's personality into an Ollama model
- agent
- MODELFILE
This is one of the most conceptually fun nodes in the whole Griptape pack, and it solves a real problem. You've built a Griptape agent - rulesets that define its personality, a conversation memory full of good examples. Now imagine turning all of that into a standalone Ollama model that has the same behavior built in, permanently. That's what this node does: it takes an agent and generates a Modelfile - the recipe file Ollama uses to build custom models - with your agent's system prompt, rules, and conversation history baked in.
Why bother? Because a custom Ollama model is a packaged thing. It doesn't need a ComfyUI graph, a Griptape agent, or the pack running at all. Once you build it, you can load it in any Ollama client and get the same persona with zero setup. It's your agent as a portable artifact. This is also genuinely two-node flow, and the node is only half of it - this one creates the Modelfile string, and the sibling "Griptape Util: Create Model from Modelfile" node builds the actual model. Together they're the "freeze my agent" pipeline.
How it works
The node inspects your agent and writes an Ollama Modelfile as a text string. It starts with a FROM line pointing at your base model, then, depending on your toggles: appends a SYSTEM block built from the agent's rulesets (the personality), and MESSAGE lines replaying the agent's conversation memory (few-shot behavior examples). The output is that Modelfile as a string, ready to hand to the build node.
One detail to note: the base_model input is populated from the models you actually have installed in Ollama (the source pulls the list from your local Ollama server), and it's required - you need Ollama running with at least one model pulled before this node will even validate.
The inputs that matter
- base_url and port - where Ollama lives, defaulting to
http://127.0.0.1:11434. Only touch these if Ollama isn't on localhost. - base_model - which model to build on top of (e.g.
llama3). The dropdown comes from your installed Ollama models. - agent - the AGENT whose rulesets and memory get frozen in. Required.
- include_conversation_memory and include_rulesets - both default
True. Flip them off if you want a clean model with just the base persona and no conversation baggage. Including conversation memory is a neat few-shot trick but can bloat the model if the memory is long.
The single output, MODELFILE (STRING), feeds straight into "Griptape Util: Create Model from Modelfile."
Install
Same pack, and one hard prerequisite: Ollama installed and running (https://ollama.com, then ollama run llama3 or similar to pull a base model). The node won't validate without it. The pack itself installs normally:
cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
or ComfyUI Manager → search "Griptape" → install → restart.
Where people get burned
The validation error - "You must have ollama installed on your machine to use this node" - is the #1 wall, and it's almost always just Ollama not running or no model pulled yet. Second, remember this node only generates the recipe; nothing gets built until you run the second node, and that one needs Ollama too. Finally, watch the conversation memory toggle: including a long chat history makes the Modelfile huge and the resulting model slow to load. For a personality bake, rulesets alone usually carry the weight; add memory only when you want specific behavior examples.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | http://127.0.0.1 | The base URL of the Ollama server |
| port | STRING | 11434 | The port of the Ollama server |
| base_model | COMBO | The base model to use | |
| agent | AGENT | — | |
| include_conversation_memory | BOOLEAN | true | — |
| include_rulesets | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODELFILE | STRING | — |