Skip to content

How-ToGPU

How to Use Fabric with Ollama for Local AI Prompts

Fabric turns reusable AI prompts into terminal commands. We show how to install it on Windows, connect it to Ollama for local models, run patterns such as summarize, raise the context length and add your own patterns.

By , Systems & Technical Editor

4 min read

How to Use Fabric with Ollama for Local AI Prompts

This guide is based on Fabric's README and source code on GitHub and Ollama's documentation, read on 3 December 2026.

Fabric is an open-source command-line tool from Daniel Miessler that wraps reusable AI prompts, which it calls Patterns, into simple commands. Instead of pasting a long prompt into a chat window every time, you pipe text into a pattern such as summarize or extract_wisdom and get a structured answer back in the terminal. Fabric works with cloud services, but its README also lists Ollama (local models) and LM Studio as native providers, so you can run every pattern on your own graphics card and keep the text on your PC.

If you'd rather have a general-purpose terminal chat tool, see our comparison of AIChat and LLM CLI or our roundup of the best command-line tools for local LLMs.

What you need

  • Ollama with a chat model pulled. Our guide to running AI models locally with Ollama and LM Studio covers installation and downloading a model.

  • A terminal. On Windows, Windows Terminal with PowerShell works well.

  • A graphics card with enough memory for the model. Fabric only builds the prompt and sends it on; Ollama does the work. Our VRAM guide explains what fits on 8GB, 12GB and 16GB cards.

Step 1: Install Fabric

Fabric's README offers several install routes. On Windows, the simplest is Microsoft's package manager:

winget install danielmiessler.Fabric

The README also gives a one-line PowerShell installer and a scoop install fabric-ai option. On macOS, brew install fabric-ai works, and on any system with Go installed you can run go install github.com/danielmiessler/fabric/cmd/fabric@latest. Note that the Homebrew and Arch Linux packages install the command as fabric-ai rather than fabric; the README suggests adding an alias.

Step 2: Run setup and point it at Ollama

Start Ollama, then run:

fabric --setup

The setup menu (also available as fabric -S) walks through Fabric's configurable parts, including AI providers. Choose Ollama. Fabric's source code shows its default Ollama address is http://localhost:11434, which is Ollama's standard local address, so you can usually accept it. The API key question is optional and can be left blank for a normal local Ollama install.

Once setup finishes, list the models Fabric can see with:

fabric -L

Your Ollama models should appear in the list. You can then pick one per command with -m.

Step 3: Run your first pattern

Patterns read from standard input, so you pipe text in. In PowerShell, to summarise a text file:

Get-Content .\notes.txt | fabric -p summarize -s

-p (or --pattern) chooses the pattern and -s (--stream) prints the answer as it is generated. On macOS the README's own example uses pbpaste | fabric --pattern summarize. Use fabric -l to list every installed pattern and fabric -U to update them.

To save the result rather than reading it on screen, add -o summary.md. To copy it to the clipboard, add -c.

Step 4: Give long documents enough context

This is the step most people miss with local models. Ollama's FAQ says it uses a context window of 4096 tokens by default, which is too small for a long article or meeting transcript, so the end of your input may simply be cut off. Fabric has a --modelContextLength option that, according to its help text, "only affects ollama":

Get-Content .\transcript.txt | fabric -p summarize_meeting --modelContextLength 16384

Alternatively, raise Ollama's default with the OLLAMA_CONTEXT_LENGTH environment variable, as described in Ollama's FAQ. A bigger context window uses more graphics memory, so on an 8GB card you may need a smaller model to make room. Our best local LLMs for 12GB of VRAM guide covers model choice.

Step 5: Use a different model for each pattern

Fabric's README describes per-pattern model mapping through environment variables of the form FABRIC_MODEL_PATTERN_NAME=vendor|model. That lets you send quick jobs such as improve_writing to a small, fast model and heavier ones such as analyze_claims to a larger model, without typing -m every time.

Step 6: Create your own pattern

A pattern is just a folder containing a system.md file with the prompt. Fabric's README recommends setting a separate custom patterns directory in fabric --setup (under the Tools menu), so updates don't overwrite your work. Then:

  1. Create a folder in that directory, for example my-analyzer.

  2. Put your instructions in my-analyzer/system.md.

  3. Run it like any other pattern: fabric -p my-analyzer.

Before spending time on a long run, fabric --dry-run -p my-analyzer shows what would be sent to the model without sending it.

Optional: use patterns from other apps

Fabric can run as a local server with fabric --serve (port 8080 by default). Adding --serveOllama exposes Ollama-style endpoints, and the README says patterns then appear as models such as summarize:latest, so apps that already speak to Ollama can call Fabric patterns. If you do this, the --api-key option can secure the server's routes.

Troubleshooting

  • No Ollama models listed: check Ollama is running and that the address in fabric --setup matches it (by default http://localhost:11434).

  • Answers ignore the end of your text: raise the context length as in Step 4.

  • Answers are slow: the model may be spilling out of graphics memory into system RAM. Try a smaller model or a smaller context window.

  • fabric isn't recognised after a Homebrew install: the command is fabric-ai unless you add an alias.

Which graphics card helps

Fabric doesn't need a GPU itself, but local models do. A 12GB card such as the ASUS RTX 3060 12GB Dual Gaming OC V2 leaves more room for larger models and context than an 8GB card like the ASUS RTX 5060 8GB Dual OC. We haven't measured speed on either card with Fabric.

The bottom line

Fabric turns reusable prompts into terminal commands, and it works with Ollama out of the box. Install it with winget (or Homebrew or Go), run fabric --setup, choose Ollama at its default http://localhost:11434, then pipe text into patterns such as summarize with -p. For long documents raise the context with --modelContextLength, because Ollama defaults to 4096 tokens, and keep your own prompts in a separate custom patterns folder.

In this article

Sources

  1. 01Fabric on GitHub, README
  2. 02Fabric source code, Ollama provider (ollama.go)
  3. 03Ollama on GitHub, FAQ

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

Best Free Android Screen Mirroring Apps for PC (2026)

Best Picks

Best Free Android Screen Mirroring Apps for PC (2026)

The best free apps to mirror and control your Android phone on a PC in 2026: scrcpy for almost any phone, Phone Link on supported models, Escrcpy and QtScrcpy for a graphical interface, and Vysor for browser and iPhone support.

Hannah Vance6 min

scrcpy vs Phone Link: Best Way to Use Android Apps on a PC?

Versus

scrcpy vs Phone Link: Best Way to Use Android Apps on a PC?

scrcpy and Microsoft Phone Link both put your Android phone's apps on a Windows PC for free. We compare phone support, setup, how each shows your apps, extra features and privacy to help you pick the right one.

Callum Reid5 min

How to Mirror and Control Your Android Phone on a PC with scrcpy

How-To

How to Mirror and Control Your Android Phone on a PC with scrcpy

scrcpy is a free, open-source app that mirrors your Android phone's screen and sound on a Windows PC and lets you control it with your mouse and keyboard. We show how to enable USB debugging, install it, connect over USB or Wi-Fi, use the best shortcuts and options, and fix common errors.

Marcus Thorne7 min