nsfwapis.com
// Guide / Models

Ollama abliterated models: setup, hardware and when an API is cheaper

Ollama abliterated models are community builds of open-weight models with refusals removed, packaged so a single ollama run command downloads and starts them. This guide covers where to find them, how to pick a tag that fits your GPU, the context and memory settings that trip people up, and a worked example of when a hosted API is cheaper than running one yourself.

What are Ollama abliterated models?

They are abliterated models, open-weight models with the refusal direction removed from their weights, converted to GGUF and published to the Ollama library so you can run them with one command. Ollama handles the download, the quantized file, the chat template and a local server. You don’t touch Python or a model loader.

The edit itself is the same one described in what abliterated models are: nothing is retrained, so an abliterated Qwen or Gemma knows exactly what the original knew and needs exactly as much memory. What Ollama adds is packaging. That matters, because packaging choices (the default tag, the quantization, the context length) decide how well the model runs on your machine more than the abliteration does.

The family guides cover each model’s versions and quirks in depth: Qwen, Gemma, GLM and DeepSeek. This post is about the Ollama side: finding builds, sizing them and configuring them.

Where to find abliterated models for Ollama

There are two places to look: the Ollama library and Hugging Face. The library is simpler. Hugging Face has far more choice.

In the Ollama library, search for “abliterated”. Most results come from one publisher, huihui_ai, which has packaged abliterated builds of most popular open model families. Community models on Ollama always carry the publisher’s name before a slash, so an abliterated model never looks like an official one. These are the main packages the other guides on this site cover:

Main abliterated model packages on Ollama, as listed at the time of writing
Ollama packageBase familyNotes
huihui_ai/qwen3-abliteratedQwen3Sizes from 0.6b to 235b, plus tags for the 2507 updates
huihui_ai/qwen3.5-abliteratedQwen 3.5Tags for 0.8b, 2b, 4b, 9b, 27b, 35b and 122b. Needs a recent Ollama.
huihui_ai/gemma3-abliteratedGemma 3Tags from 270m to 27b. Some tags default to f16.
huihui_ai/gemma-4-abliteratedGemma 4e2b, e4b, 26b and 31b tags at Q4_K_M
huihui_ai/glm-4.7-flash-abliteratedGLM-4.7-Flash30B mixture-of-experts with about 3B active parameters
huihui_ai/deepseek-r1-abliteratedDeepSeek-R1 distills1.5b to 70b. These are Qwen and Llama distills, not the 671B R1.

On Hugging Face, abliterated models are usually uploaded twice: once as full-precision weights and once as a GGUF repo, often by a different account that does the quantizing. Ollama can run a GGUF repo directly, without anyone packaging it for the library:

ollama run hf.co/<user>/<repo>:Q4_K_M

According to the Hugging Face documentation, the quantization tag is optional and case-insensitive. If you leave it out, Ollama uses Q4_K_M when the repo has it, or another quantization from the repo when it doesn’t. Name the tag yourself so you know what you downloaded. This route is how you get builds that the Ollama library doesn’t carry, such as mlabonne’s layerwise Gemma 3 abliterations or a v2 of a model that was updated after its Ollama package.

How to run an abliterated model with Ollama, step by step

Running an abliterated model takes four commands once Ollama is installed. Here is the full sequence, using the Qwen 3.5 abliterated Ollama package as the example:

  1. Update Ollama. New architectures need new Ollama releases, and the Qwen 3.5 and Gemma 4 packages list minimum versions. Check yours with ollama --version and upgrade from the official site or the GitHub releases page.
  2. Pull a specific tag. ollama pull huihui_ai/qwen3.5-abliterated:9b downloads the 9B build. Always give a tag. The bare name pulls whatever the publisher set as latest, which may be a size or precision you didn’t want.
  3. Run it. ollama run huihui_ai/qwen3.5-abliterated:9b opens an interactive chat. Type /bye to leave it.
  4. Check where it loaded. In a second terminal, ollama ps shows the loaded model, its size, the context length it got and the PROCESSOR split. You want “100% GPU”. A split like “40%/60% CPU/GPU” means part of the model spilled into system RAM, and output will be several times slower.

ollama list shows what you have downloaded and ollama rm deletes a model. Abliterated builds are large and easy to collect, so clean up the ones you’ve stopped testing.

By default Ollama unloads a model after five minutes without requests and loads it again on the next one, which adds a pause of seconds to a minute depending on size. For an app that gets occasional traffic, set OLLAMA_KEEP_ALIVE on the server (for example 30m, or -1 to keep it loaded) or pass keep_alive in the API request.

Which tag fits your GPU?

Pick the largest model whose 4-bit file, plus its context cache, fits entirely in your GPU memory (or unified memory on a Mac). A useful rule is a little over half a gigabyte per billion parameters at Q4_K_M.

Rough guide to abliterated model sizes by GPU memory at 4-bit quantization, before a long context cache
Memory availableDense models that fit at 4-bitMixture-of-experts optionsExample tags
8 GBUp to about 8B, with a short contextNone of the large onesqwen3.5-abliterated:4b, gemma3-abliterated 4b (pick a quantized tag)
12 to 16 GBAbout 9B to 14BTight. Gemma 4 E4B at about 10 GB.qwen3.5-abliterated:9b, qwen3-abliterated:14b, gemma-4-abliterated:e4b
24 GB27B to 32B26B to 35B models with 3B to 4B activeqwen3.5-abliterated:27b, gemma-4-abliterated:31b, glm-4.7-flash-abliterated
48 GB or more70B at 4-bitLarger MoE models with partial offloaddeepseek-r1-abliterated:70b

Two traps are specific to abliterated packages. First, precision. Abliterated builds are often uploaded at f16 first and quantized later, and some Ollama tags still default to f16. The huihui_ai/gemma3-abliterated 4B tag, for example, is listed at 8.6 GB, about twice what a 4-bit file needs. Check the size on the tag page before you pull. Second, quantization quality. Abliteration is a small, targeted change to the weights, and very low quantizations (Q2, Q3) add their own damage on top. Stay at Q4_K_M or above unless you have no other way to fit the model.

Mixture-of-experts models change the trade-off. A 35B model with 3B active parameters needs memory for all 35B but generates at roughly the speed of a 3B model. If you have 24 GB, compare an MoE build with a dense 27B on the same prompts: the MoE is faster, the dense model usually follows long instructions better.

Context length, the Modelfile and memory settings

Ollama’s default context is often too short for chat and roleplay, so set it yourself. Per Ollama’s context-length documentation, the default depends on VRAM: 4K tokens under 24 GiB, 32K from 24 to 48 GiB, and 256K at 48 GiB or more. Older Ollama versions used a fixed default of 2,048 or 4,096 tokens. When a conversation outgrows the window, Ollama drops the oldest tokens without warning, which is why a character can suddenly forget its own card.

You can set the context in three places:

  • Server-wide: start the server with OLLAMA_CONTEXT_LENGTH=16384.
  • Per request: pass "options": {"num_ctx": 16384} to Ollama’s native /api/chat endpoint.
  • In a custom model: write a Modelfile and build your own tag. This is the cleanest option for an app, because every client gets the same settings.

A Modelfile for a roleplay build of an abliterated model looks like this:

FROM huihui_ai/qwen3.5-abliterated:27b
PARAMETER num_ctx 16384
PARAMETER temperature 0.8
SYSTEM """You are the narrator of an interactive story. Stay in character."""

Build it with ollama create rp-qwen -f Modelfile, then call rp-qwen like any other model. The new tag reuses the downloaded weights, so it costs almost no disk space.

Context isn’t free. The cache grows with every token of context, and on a 24 GB card a 27B model at 16K context may already be close to the limit. If ollama ps shows part of the model on the CPU after you raise num_ctx, either lower it or shrink the cache: with flash attention on (OLLAMA_FLASH_ATTENTION=1), setting OLLAMA_KV_CACHE_TYPE=q8_0 stores the cache at 8-bit, about half the memory of the default f16, at a small cost in precision.

Using Ollama as a local abliterated model API

Ollama runs a server on localhost:11434 whenever it’s running, with two APIs: its native one under /api and an OpenAI-compatible one under /v1. Point the OpenAI SDK, SillyTavern or any chat front end at /v1, use any non-empty string as the key, and pass the Ollama model name (for example huihui_ai/qwen3.5-abliterated:9b) as the model ID. The free uncensored API guide has a Python example, and the SillyTavern guide covers the client settings.

A few limits matter once more than one person uses it:

  • Concurrency. Ollama can serve parallel requests to a loaded model (OLLAMA_NUM_PARALLEL), but each parallel slot needs its own context cache, so memory use rises with every slot. One consumer GPU serves a handful of simultaneous chats, not hundreds.
  • Exposure. Ollama listens on localhost by default and has no built-in authentication. If you set OLLAMA_HOST to expose it, put it behind a reverse proxy with a key, or anyone who finds the port can use your GPU.
  • Native options. Settings like num_ctx and keep_alive aren’t part of the OpenAI format. Bake them into a Modelfile or set them on the server when you use /v1.

Because the hosted providers in this directory also speak the OpenAI format, the same client code can switch between your local abliterated model and a hosted one with a base URL, key and model ID change. The OpenAI-compatible API guide shows how.

When is a hosted API cheaper than running locally?

A hosted API is usually cheaper at low or uneven volume, and local hardware wins only when it runs busy for many hours a day. The reason is the cost shape: a GPU is a fixed cost whether you use it or not, while an API charges only for the tokens you send.

Here is a worked example. The local side uses assumptions you should replace with your own numbers: a $800 GPU written off over 24 months, drawing 350 W for 8 hours a day at $0.15 per kWh. That comes to about $45.93 a month ($33.33 for the card and $12.60 for power), before the rest of the computer. The hosted side uses published catalog rates for the roleplay chat turn workload used across this site: 6,000 input and 300 output tokens per turn, before caching.

Monthly cost of 6,000-input, 300-output roleplay turns: an assumed local GPU against the cheapest hosted abliterated and uncensored models in the directory, at published USD rates
Option5,000 turns a month50,000 turns a month500,000 turns a month
Local GPU (assumptions above)$45.93$45.93$45.93
DeepSeek V4.1 Flash 1017 Abliterated on Refuseless$4.275$42.75$427.50
GLM-5.3 Flash Uncensored on Unaligned$2.04$20.40$204.00

On these assumptions, DeepSeek V4.1 Flash 1017 Abliterated on Refuseless costs less than the local GPU up to about 53,723 turns a month, and GLM-5.3 Flash Uncensored on Unaligned up to about 112,582. Above that, the local card is cheaper per turn, if it can keep up. A single consumer GPU running a 27B model handles one or a few chats at a time, so high volume may need more cards, which moves the break-even again.

The comparison also isn’t like for like. The hosted abliterated models here are large mixture-of-experts models with up to 1M tokens of context, much bigger than anything a 24 GB card holds. A local 9B or 27B abliterated model is cheaper to run but writes and remembers less well. If you already own the GPU, the card cost drops out and local becomes the cheap option at almost any volume you can serve. Privacy can decide it too: a local model sends nothing off your machine.

Checklist for running abliterated models in Ollama

  1. Update Ollama first. Most loading errors with new abliterated packages come from an old version.
  2. Pull a named tag. Check its size on the tag page and avoid f16 unless you have the memory.
  3. Read the model card. Note the base model, the abliteration method and version, and the license, which carries over from the base model.
  4. Confirm 100% GPU with ollama ps after the first prompt.
  5. Set the context on purpose. Put num_ctx in a Modelfile and size it to your longest real chat.
  6. Test on your own prompts. Use 20 to 50 real prompts and compare two builds or sizes before you commit.
  7. Price the hosted alternative with your real monthly volume before you buy hardware for it.

Abliteration removes refusals, not laws. Sexual content involving minors, and intimate images of real people made without consent, are illegal whatever model or machine produces them.

Frequently asked questions

How do I run an abliterated model in Ollama?

Install or update Ollama, then run a community package with a tag, for example ollama run huihui_ai/qwen3.5-abliterated:9b. For a GGUF build on Hugging Face, use ollama run hf.co/<user>/<repo>:Q4_K_M.

Is there a Qwen 3.5 abliterated model on Ollama?

Yes. huihui_ai publishes huihui_ai/qwen3.5-abliterated with tags for 0.8b, 2b, 4b, 9b, 27b, 35b and 122b. It needs a recent Ollama version, so update before you pull it.

Why does my Ollama abliterated model forget the start of the chat?

The conversation has outgrown the context window, and Ollama drops the oldest tokens. Raise num_ctx in a Modelfile or set OLLAMA_CONTEXT_LENGTH on the server, and check with ollama ps that the model still fits on the GPU.

What GPU do I need for abliterated models in Ollama?

At 4-bit quantization, plan for a little over half a gigabyte per billion parameters plus the context cache. A 12 to 16 GB GPU runs 9B to 14B models, and a 24 GB GPU runs 27B to 32B dense models or 30B-class mixture-of-experts models.

Is running an abliterated model in Ollama cheaper than an API?

Only at steady, high volume or if you already own the GPU. A hosted API charges per token, so at a few thousand chat turns a month it usually costs less than buying and powering a card.

Sources

Prices and offers come from each provider’s published information, checked . They can change, so confirm them on the provider’s site. Found something out of date? Tell us.