News for hackers. Stuff that matters.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @10:14AM (#43743896)
I think gemma-3-27b-it-qat-4bit is my new favorite local model - or at least it's right up there with Mistral Small 3.1 24B.

I've been trying it on an M2 64GB via both Ollama and MLX. It's very, very good, and it only uses ~22Gb (via Ollama) or ~15GB (MLX) leaving plenty of memory for running other apps.

Some notes here: https://simonwillison.net/2025/Apr/19/gemma-3-qat-models/

Last night I had it write me a complete plugin for my LLM tool like this:

  llm install llm-mlx
  llm mlx download-model mlx-community/gemma-3-27b-it-qat-4bit

  llm -m mlx-community/gemma-3-27b-it-qat-4bit \
    -f https://raw.githubusercontent.com/simonw/llm-hacker-news/refs/heads/main/llm_hacker_news.py \
    -f https://raw.githubusercontent.com/simonw/tools/refs/heads/main/github-issue-to-markdown.html \
    -s 'Write a new fragments plugin in Python that registers
    issue:org/repo/123 which fetches that issue
        number from the specified github repo and uses the same
        markdown logic as the HTML page to turn that into a
        fragment'
It gave a solid response! https://gist.github.com/simonw/feccff6ce3254556b848c27333f52... - more notes here: https://simonwillison.net/2025/Apr/20/llm-fragments-github/
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by rs186 on Sunday April 20, 2025 @10:22AM (#43743949)
Can you quote tps?

More and more I start to realize that cost saving is a small problem for local LLMs. If it is too slow, it becomes unusable, so much that you might as well use public LLM endpoints. Unless you really care about getting things done locally without sending information to another server.

With OpenAI API/ChatGPT, I get response much faster than I can read, and for simple question, it means I just need a glimpse of the response, copy & paste and get things done. Whereas on local LLM, I watch it painstakingly prints preambles that I don't care about, and get what I actually need after 20 seconds (on a fast GPU).

And I am not yet talking about context window etc.

I have been researching about how people integrate local LLMs in their workflows. My finding is that most people play with it for a short time and that's about it, and most people are much better off spending money on OpenAI credits (which can last a very long time with typical usage) than getting a beefed up Mac Studio or building a machine with 4090.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @10:36AM (#43744051)
My tooling doesn't measure TPS yet. It feels snappy to me on MLX.

I agree that hosted models are usually a better option for most people - much faster, higher quality, handle longer inputs, really cheap.

I enjoy local models for research and for the occasional offline scenario.

I'm also interested in their applications for journalism, specifically for dealing with extremely sensitive data like leaked information from confidential sources.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by freeamz on Sunday April 20, 2025 @11:26AM (#43744385)
>I'm also interested in their applications for journalism, specifically for dealing with extremely sensitive data like leaked information from confidential sources.

Think it is NOT just you. Most company with decent management also would not want their data going to anything outside the physical server they have in control of. But yeah for most people just use an app and hosted server. But this is HN,there are ppl here hosting their own email servers, so shouldn't be too hard to run llm locally.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @11:45AM (#43744513)
"Most company with decent management also would not want their data going to anything outside the physical server they have in control of."

I don't think that's been true for over a decade: AWS wouldn't be trillion dollar business if most companies still wanted to stay on-premise.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by __float on Sunday April 20, 2025 @12:17PM (#43744716)
While none of that is false, I think there's a big difference from shipping your data to an external LLM API and using AWS.

Using AWS is basically a "physical server they have control of".

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @01:11PM (#43745030)
That's why AWS Bedrock and Google Vertex AI and Azure AI model inference exist - they're all hosted LLM services that offer the same compliance guarantees that you get from regular AWS-style hosting agreements.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by IanCal on Sunday April 20, 2025 @02:22PM (#43745490)
As in aws is a much bigger security concern?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by terhechte on Sunday April 20, 2025 @11:59AM (#43744600)
Or GitHub. I’m always amused when people don’t want to send fractions of their code to a LLM but happily host it on GitHub. All big llm providers offer no-training-on-your-data business plans.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by tarruda on Sunday April 20, 2025 @12:34PM (#43744807)
> I’m always amused when people don’t want to send fractions of their code to a LLM but happily host it on GitHub

What amuses me even more is people thinking their code is too unique and precious, and that GitHub/Microsoft wants to steal it.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by vikarti on Sunday April 20, 2025 @03:50PM (#43746078)
Regulations sometimes matter. Stupid "security" rules sometimes matter too.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by AlexCoventry on Sunday April 20, 2025 @12:40PM (#43744838)
Concern about platform risk in regard to Microsoft is historically justified.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by Terretta on Sunday April 20, 2025 @12:41PM (#43744843)
Unlikely they think Microsoft or GitHub wants to steal it.

With LLMs, they're thinking of examples that regurgitated proprietary code, and contrary to everyday general observation, valuable proprietary code does exist.

But with GitHub, the thinking is generally the opposite: the worry is that the code is terrible, and seeing it would be like giant blinkenlights* indicating the way in.

* https://en.wikipedia.org/wiki/Blinkenlights

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by ipdashc on Sunday April 20, 2025 @07:17PM (#43747248)
Yeah, this has been confusing me a bit. I'm not complaining by ANY means, but why does it suddenly feel like everyone cares about data privacy in LLM contexts, way more than previous attitudes to allowing data to sit on a bunch of random SaaS products?

I assume because of the assumption that the AI companies will train off of your data, causing it to leak? But I thought all these services had enterprise tiers where they'll promise not to do that?

Again, I'm not complaining, it's good to see people caring about where their data goes. Just interesting that they care now, but not before. (In some ways LLMs should be one of the safer services, since they don't even really need to store any data, they can delete it after the query or conversation is over.)

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by pornel on Sunday April 20, 2025 @08:22PM (#43747566)
It is due to the risk of a leak.

Laundering of data through training makes it a more complicated case than a simple data theft or copyright infringement.

Leaks could be accidental, e.g. due to an employee logging in to their free-as-in-labor personal account instead of a no-training Enterprise account. It's safer to have a complete ban on providers that may collect data for training.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by vbezhenar on Sunday April 20, 2025 @10:46PM (#43748126)
How can you be sure that AWS will not use your data to train their models? They got enormous data, probably most data in the world.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Monday April 21, 2025 @12:27AM (#43748498)
Being caught doing they would be wildly harmful to their business - billions of dollars harmful, especially given the contracts they sign with their customers. The brand damage would be unimaginably expensive too.

There is no world in which training on customer data without permission would be worth it for AWS.

Your data really isn't that useful anyway.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by mdp2021 on Monday April 21, 2025 @04:30PM (#43756131)
> Your data really isn't that useful anyway

? One single random document, maybe, but as an aggregate, I understood some parties were trying to scrape indiscriminately - the "big data" way. And if some of that input is sensitive, and is stored somewhere in the NN, it may come out in an output - in theory...

Actually I never researched the details of the potential phenomenon - that anything personal may be stored (not just George III but Random Randy) -, but it seems possible.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Monday April 21, 2025 @04:56PM (#43756371)
There's a pretty common misconception that training LLMs is about loading in as much data as possible no matter the source.

That might have been true a few years ago but today the top AI labs are all focusing on quality: they're trying to find the best possible sources of high quality tokens, not randomly dumping in anything they can obtain.

Andrej Karpathy said this last year: https://twitter.com/karpathy/status/1797313173449764933

> Turns out that LLMs learn a lot better and faster from educational content as well. This is partly because the average Common Crawl article (internet pages) is not of very high value and distracts the training, packing in too much irrelevant information. The average webpage on the internet is so random and terrible it's not even clear how prior LLMs learn anything at all.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by mdp2021 on Monday April 21, 2025 @06:31PM (#43757227)
Obviously the training data should be preferably high quality - but there you have a (pseudo-, I insisted also elsewhere citing the rights to have read whatever is in any public library) problem with "copyright".

If there exists some advantage on quantity though, then achieving high quality imposes questions about tradeoffs and workflows - sources where authors are "free participants" could have odd data sip in.

And the matter of whether such data may be reflected in outputs remains as a question (probably tackled by some I have not read... Ars longa, vita brevis).

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by 6510 on Sunday April 20, 2025 @09:10PM (#43747740)
Their entire business model based on taking other peoples stuff. I cant imagine someone would willingly drown with the sinking ship if the entire cargo is filled with lifeboats - just because they promised they would.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by freeamz on Monday April 21, 2025 @05:27AM (#43749913)
In Scandinavian financial related severs must in the country! That always sounded like a sane approach. The whole putting your data on saas or AWS just seems like the same "Let's shift the responsibility to a big player".

Any important data should NOT be in devices that is NOT physically with in our jurisdiction.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by mjlee on Sunday April 20, 2025 @11:43PM (#43748353)
AWS has a strong track record, a clear business model that isn’t predicated on gathering as much data as possible, and an awful lot to lose if they break their promises.

Lots of AI companies have some of these, but not to the same extent.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by Tepix on Monday April 21, 2025 @12:14AM (#43748456)
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by belter on Monday April 21, 2025 @09:27AM (#43751797)
> "Most company with decent management also would not want their data going to anything outside the physical server they have in control of."

Most companies physical and digital security controls are so much worst than anything from AWS or Google. Note I dont include Azure...but a physical server they have control of is a phrase that screams vulnerability.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by triyambakam on Monday April 21, 2025 @12:37AM (#43748537)
> specifically for dealing with extremely sensitive data like leaked information from confidential sources.

Can you explain this further? It seems in contrast to your previous comment about trusting Anthropic with your data

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Monday April 21, 2025 @01:14AM (#43748676)
I trust Anthropic not to train on my data.

If they get hit by a government subpoena because a journalist has been using them to analyze leaked corporate or government secret files I also trust them to honor that subpoena.

Sometimes journalists deal with material that they cannot risk leaving their own machine.

"News is what somebody somewhere wants to suppress"

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by overfeed on Sunday April 20, 2025 @11:27AM (#43744387)
> Whereas on local LLM, I watch it painstakingly prints preambles that I don't care about, and get what I actually need after 20 seconds.

You may need to "right-size" the models you use to match your hardware, model, and TPS expectations, which may involve using a smaller version of the model with faster TPS, upgrading your jardware, or paying for hosted models.

Alternatively, if you can use agentic workflows or tools like Aider, you don't have to watch the model work slowly with large modles locally. Instead you queue work for it, go to sleep, or eat, or do other work, and then much later look over the Pull Requests whenever it completes them.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by rs186 on Sunday April 20, 2025 @04:33PM (#43746346)
I have a 4070 super for gaming, and used it to play with LLM a few times. It is by no means a bad card, but I realize that unless I want to get 4090 or new Macs that I don't have any other use for, I can only use it to run smaller models. However, most smaller models aren't satisfactory and are still slower than hosted LLMs. I haven't found a model that I am happy with for my hardware.

Regarding agentic workflows -- sounds nice but I am too scared to try it out, based on my experience with standard LLMs like GPT or Claude for writing code. Small snippets or filling in missing unit tests, fine, anything more complicated? Has been a disaster for me.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by taneq on Monday April 21, 2025 @02:39AM (#43748998)
As I understand it, these models are limited on GPU memory far more than GPU compute. You’d be better off with dual 4070s than with a single 4090 unless the 4090 has more RAM than the other two combined.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by adastra22 on Monday April 21, 2025 @01:21AM (#43748697)
I have never found any agent able to put together sensible pull requests without constant hand holding. I shudder to think of what those repositories must look like.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by otabdeveloper4 on Sunday April 20, 2025 @12:42PM (#43744850)
The only actually useful application of LLM's is processing large amounts of data for classification and/or summarizing purposes.

That's not the stuff you want to send to a public API, this is something you want as a 24/7 locally running batch job.

("AI assistant" is an evolutionary dead end, and Star Trek be damned.)

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by DJHenk on Sunday April 20, 2025 @02:36PM (#43745587)
> More and more I start to realize that cost saving is a small problem for local LLMs. If it is too slow, it becomes unusable, so much that you might as well use public LLM endpoints. Unless you really care about getting things done locally without sending information to another server.

There is another aspect to consider, aside from privacy.

These models are trained by downloading every scrap of information from the internet, including the works of many, many authors who have never consented to that. And they for sure are not going to get a share of the profits, if there is every going to be any. If you use a cloud provider, you are basically saying that is all fine. You are happy to pay them, and make yourself dependent on their service, based on work that wasn't theirs to use.

However, if you use a local model, the authors still did not give consent, but one could argue that the company that made the model is at least giving back to the community. They don't get any money out of it, and you are not becoming dependent on their hyper capitalist service. No rent-seeking. The benefits of the work are free to use for everyone. This makes using AI a little more acceptable from a moral standpoint.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by ein0p on Sunday April 20, 2025 @02:40PM (#43745615)
Sometimes TPS doesn't matter. I've generated textual descriptions for 100K or so images in my photo archive, some of which I have absolutely no interest in uploading to someone else's computer. This works pretty well with Gemma. I use local LLMs all the time for things where privacy is even remotely important. I estimate this constitutes easily a quarter of my LLM usage.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by lodovic on Sunday April 20, 2025 @03:03PM (#43745771)
This is a really cool idea. Do you pretrain the model so it can tag people? I have so many photo's that it seems impossible to ever categorize them,using a workflow like yours might help a lot
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by ein0p on Sunday April 20, 2025 @03:10PM (#43745820)
No, tagging of people is already handled by another model. Gemma just describes what's in the image, and produces a comma separated list of keywords. No additional training is required besides a few tweaks to the prompt so that it outputs just the description, without any "fluff". E.g. it normally prepends such outputs with "Here's a description of the image:" unless you really insist that it should output only the description. I suppose I could use constrained decoding into JSON or something to achieve the same, but I didn't mess with that.

On some images where Gemma3 struggles Mistral Small produces better descriptions, BTW. But it seems harder to make it follow my instructions exactly.

I'm looking forward to the day when I can also do this with videos, a lot of which I also have no interest in uploading to someone else's computer.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by fer on Sunday April 20, 2025 @04:30PM (#43746325)
How do you use the keywords after? I have Immich running which does some analysis, but the querying is a bit of a hit and miss.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by ein0p on Sunday April 20, 2025 @04:44PM (#43746405)
Search is indeed hit and miss. Immich, for instance, currently does absolutely nothing with the EXIF "description" field, so I store textual descriptions on the side as well. I have found Immich's search by image embeddings to be pretty weak at recall, and even weaker at ranking. IIRC Lightroom Classic (which I also use, but haven't found a way to automate this for without writing an extension) does search that field, but ranking is a bit of a dumpster fire, so your best bet is searching uncommon terms or constraining search by metadata (e.g. not just "black kitten" but "black kitten AND 2025"). I expect this to improve significantly over time - it's a fairly obvious thing to add given the available tech.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by ethersteeds on Monday April 21, 2025 @01:02AM (#43748621)
> No, tagging of people is already handled by another model.

As an aside, what model/tools do you prefer for tagging people?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by mentalgear on Monday April 21, 2025 @02:18AM (#43748921)
Since you already seem to have done some impressive work on this for your personal use, would you mind open sourcing it?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by starik36 on Sunday April 20, 2025 @07:07PM (#43747204)
I was thinking of doing the same, but I would like to include people's name. in the description. For example "Jennifer looking out in the desert sky.".

As it stands, Gemma will just say "Woman looking out in the desert sky."

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by ein0p on Monday April 21, 2025 @04:07AM (#43749446)
Most search rankers do not consider word order, so if you could also append the person's name at the end of text description, it'd probably work well enough for retrieval and ranking at least.

If you want natural language to resolve the names, that'd at a minimum require bounding boxes of the faces and their corresponding names. It'd also require either preprocessing, or specialized training, or both. To my knowledge no locally-hostable model as of today has that. I don't know if any proprietary models can do this either, but it's certainly worth a try - they might just do it. The vast majority of the things they can do is emergent, meaning they were never specifically trained to do them.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by k__ on Sunday April 20, 2025 @04:23PM (#43746287)
The local LLM is your project manager, the big remote ones are the engineers and designers :D
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by trees101 on Sunday April 20, 2025 @05:43PM (#43746724)
Not sure how accurate my stats are. I used ollama with the --verbose flag. Using a 4090 and all default settings, I get 40TPS for Gemma 29B model

`ollama run gemma3:27b --verbose` gives me 42.5 TPS +-0.3TPS

`ollama run gemma3:27b-it-qat --verbose` gives me 41.5 TPS +-0.3TPS

Strange results; the full model gives me slightly more TPS.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by orangecat on Sunday April 20, 2025 @07:40PM (#43747364)
ollama's `gemma3:27b` is also 4-bit quantized, you need `27b-it-q8_0` for 8 bit or `27b-it-fp16` for FP16. See https://ollama.com/library/gemma3/tags.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by starik36 on Sunday April 20, 2025 @06:59PM (#43747164)
On an A5000 with 24GB, this model typically gets between 20 to 25 tps.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by a_e_k on Monday April 21, 2025 @01:02AM (#43748620)
I'm seeing ~38--42 tps on a 4090 in a fresh build of llama.cpp under Fedora 42 on my personal machine.

(-t 32 -ngl 100 -c 8192 -fa -ctk q8_0 -ctv q8_0 -m models/gemma-3-27b-it-qat-q4_0.gguf)

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by pantulis on Monday April 21, 2025 @07:21AM (#43750648)
> Can you quote tps?

LLM Studio running on a Mac Studio M4 Max with 128GB, gemma-3-27B-it-QAT-Q4_0.gguf with a 4096 token context I get 8.89 tps.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by jychang on Monday April 21, 2025 @07:37AM (#43750755)
That's pretty terrible. I'm getting 18tok/sec Gemma 3 27b QAT on a M1 Max 32gb macbook.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by pantulis on Monday April 21, 2025 @07:45AM (#43750823)
Yeah, I know. Not sure if this due to something in LLM Studio or whatever.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by pantulis on Saturday April 26, 2025 @01:19PM (#43805417)
I was running the mac in low power mode!!! Getting 24tps now.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by kristianp on Monday April 21, 2025 @05:20PM (#43756621)
Is QAT a different quantisation format to Q4_0? Can you try "gemma-3-27b-it-qat" for a model: https://lmstudio.ai/model/gemma-3-27b-it-qat
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by pantulis on Tuesday April 22, 2025 @08:45AM (#43761457)
Thanks for your suggestion!

I think it was just the filename. I tried the model you suggested by opening it in LLMStudio and keep getting 8.3 tps.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by pantulis on Tuesday April 22, 2025 @08:48AM (#43761485)
Now this is raising my curiosity, is there anything else I could try and tweak to achieve better tps? Can it be related to being GGUF instead of MLX?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by pantulis on Saturday April 26, 2025 @01:18PM (#43805414)
Gah, turns out I was running the Mac in low power mode!

I get 24tps in LM Studio now with gemma-3-27b-it-qat.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by jonaustin on Monday April 21, 2025 @10:29PM (#43758570)
On a M4 Max 128GB via LM Studio:

query: "make me a snake game in python with pygame"

(mlx 4 bit quant) mlx-community/gemma-3-27b-it-qat@4bit: 26.39 tok/sec • 1681 tokens 0.63s to first token

(gguf 4 bit quant) lmstudio-community/gemma-3-27b-it-qat: 22.72 tok/sec • 1866 tokens 0.49s to first token

using Unsloth's settings: https://docs.unsloth.ai/basics/tutorial-how-to-run-and-fine-...

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by yencabulator on Tuesday April 22, 2025 @03:04PM (#43765225)
I genuinely would have expected a $3,500+ setup to do better than just 10x pure-CPU on a AMD Ryzen 9 8945HS.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by jonaustin on Saturday April 26, 2025 @03:01AM (#43801505)
Find another laptop that does that well.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by nico on Sunday April 20, 2025 @10:59AM (#43744205)
Been super impressed with local models on mac. Love that the gemma models have 128k token context input size. However, outputs are usually pretty short

Any tips on generating long output? Like multiple pages of a document, a story, a play or even a book?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @11:06AM (#43744252)
The tool you are using may set a default max output size without you realizing. Ollama has a num_ctx that defaults to 2048 for example: https://github.com/ollama/ollama/blob/main/docs/faq.md#how-c...
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by nico on Sunday April 20, 2025 @11:16AM (#43744320)
Been playing with that, but doesn’t seem to have much effect. It works very well to limit output to smaller bits, like setting it to 100-200. But above 2-4k the output seems to never get longer than about 1 page

Might try using the models with mlx instead of ollama to see if that makes a difference

Any tips on prompting to get longer outputs?

Also, does the model context size determine max output size? Are the two related or are they independent characteristics of the model?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @11:47AM (#43744532)
Interestingly the Gemma 3 docs say: https://ai.google.dev/gemma/docs/core/model_card_3#:~:text=T...

> Total output context up to 128K tokens for the 4B, 12B, and 27B sizes, and 32K tokens for the 1B size per request, subtracting the request input tokens

I don't know how to get it to output anything that length though.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by nico on Sunday April 20, 2025 @12:14PM (#43744700)
Thank you for the insights and useful links

Will keep experimenting, will also try mistral3.1

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by Gracana on Sunday April 20, 2025 @03:43PM (#43746033)
You can probably find some long-form tuned models on HF. I've had decent results with QwQ-32B (which I can run on my desktop) and Mistral Large (which I have to run on my server). Generating and refining an outline before writing the whole piece can help, and you can also split the piece up into multiple outputs (working a paragraph or two at a time, for instance). So far I've found it to be a tough process, with mixed results.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by nico on Sunday April 20, 2025 @05:28PM (#43746653)
Thank you, will try out your suggestions

Have you used something like a director model to supervise the output? If so, could you comment on the effectiveness of it and potentially any tips?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by Gracana on Sunday April 20, 2025 @08:27PM (#43747588)
Nope, sounds neat though. There's so much to keep up with in this space.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by Casteil on Sunday April 20, 2025 @11:39AM (#43744469)
This is basically the opposite of what I've experienced - at least compared to another recent entry like IBM's Granite 3.3.

By comparison, Gemma3's output (both 12b and 27b) seems to typically be more long/verbose, but not problematically so.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by nico on Sunday April 20, 2025 @01:52PM (#43745278)
I agree with you. The outputs are usually good, it’s just that for the use case I have now (writing several pages of long dialogs), the output is not as long as I’d want it, and definitely not as long as it’s supposedly capable of doing
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by tootie on Sunday April 20, 2025 @08:00PM (#43747471)
I'm using 12b and getting seriously verbose answers. It's squeezed into 8GB and takes its sweet time but answers are really solid.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by tomrod on Sunday April 20, 2025 @11:00AM (#43744215)
Simon, what is your local GPU setup? (No doubt you've covered this, but I'm not sure where to dig up).
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @11:07AM (#43744258)
MacBook Pro M2 with 64GB of RAM. That's why I tend to be limited to Ollama and MLX - stuff that requires NVIDIA doesn't work for me locally.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by Elucalidavah on Sunday April 20, 2025 @01:01PM (#43744971)
> MacBook Pro M2 with 64GB of RAM

Are there non-mac options with similar capabilities?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @01:13PM (#43745043)
Yes, but I don't really know anything about those. https://www.reddit.com/r/LocalLLaMA/ is full of people running models on PCs with NVIDIA cards.

The unique benefit of an Apple Silicon Mac at the moment is that the 64GB of RAM is available to both the GPU and the CPU at once. With other hardware you usually need dedicated separate VRAM for the GPU.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by _neil on Sunday April 20, 2025 @02:55PM (#43745718)
It’s not out yet, but the upcoming Framework desktop [0] is supposed to have a similar unified memory setup.

[0] https://frame.work/desktop

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by dwood_dev on Sunday April 20, 2025 @04:49PM (#43746431)
Anything with the Radeon 8060S/Ryzen AI Max+ 395. One of the popular MiniPC Chinese brands has them for preorder[0] with shipping starting May 7th. Framework also has them, but shipping Q3.

0: https://www.gmktec.com/products/prepaid-deposit-amd-ryzen™-a...

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by chpatrick on Sunday April 20, 2025 @09:22PM (#43747791)
I've never been able to get ROCm working reliably personally.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by danans on Sunday April 20, 2025 @07:34PM (#43747338)
Nvidia Orin AGX if a desktop form factor works for you.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by chpatrick on Sunday April 20, 2025 @09:21PM (#43747789)
I remember seeing a post about someone running the full size DeepSeek model in a dual-Xeon server with a ton of RAM.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by jychang on Monday April 21, 2025 @03:44AM (#43749324)
MLX is slower than GGUFs on Macs.

On my M1 Max macbook pro, the GGUF version bartowski/google_gemma-3-27b-it-qat-GGUF is 15.6gb and runs at 17tok/sec, whereas mlx-community/gemma-3-27b-it-qat-4bit is 16.8gb and runs at 15tok/sec. Note that both of these are the new QAT 4bit quants.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by phaedrix on Monday April 21, 2025 @11:12AM (#43752864)
No, in general mlx versions are always faster, ice tested most of them.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by 85392_school on Monday April 21, 2025 @11:44AM (#43753241)
What TPS difference are you getting?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by littlestymaar on Sunday April 20, 2025 @01:47PM (#43745256)
> and it only uses ~22Gb (via Ollama) or ~15GB (MLX)

Why is the memory use different? Are you using different context size in both set-ups?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @02:13PM (#43745420)
No idea. MLX is its own thing, optimized for Apple Silicon. Ollama uses GGUFs.

https://ollama.com/library/gemma3:27b-it-qat says it's Q4_0. https://huggingface.co/mlx-community/gemma-3-27b-it-qat-4bit says it's 4bit. I think those are the same quantization?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by jychang on Monday April 21, 2025 @03:47AM (#43749341)
Those are the same quant, but this is a good example of why you shouldn't use ollama. Either directly use llama.cpp, or use something like LM Studio if you want something with a GUI/easier user experience.

The Gemma 3 17b QAT GGUF should be taking up ~15gb, not 22gb.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by Patrick_Devine on Monday April 21, 2025 @01:57PM (#43754618)
The vision tower is 7GB, so I was wondering if you were loading it without vision?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by paprots on Sunday April 20, 2025 @03:00PM (#43745751)
The original gemma3:27b also took only 22GB using Ollama on my 64GB MacBook. I'm quite confused that the QAT took the same. Do you know why? Which model is better? `gemma3:27b`, or `gemma3:27b-qat`?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by nolist_policy on Sunday April 20, 2025 @03:05PM (#43745787)
I suspect your "original gemma3:27b" was a quantized model since the non-quantized (16bit) version needs around 54gb.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by kgwgk on Sunday April 20, 2025 @04:39PM (#43746372)
Look up 27b in https://ollama.com/library/gemma3/tags

You'll find the id a418f5838eaf which also corresponds to 27b-it-q4_K_M

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by carbocation on Tuesday April 29, 2025 @06:46PM (#43838949)
Just following this comment up as a note-to-self: just as `kgwgk noted, the default gemma3:27B model has ID a418f5838eaf, which corresponds to 27b-it-q4_K_M. But the new gemma3:27B quantization-aware training (QAT) model being discussed is gemma3:27b-it-qat with ID 29eb0b9aeda3.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by superkuh on Sunday April 20, 2025 @04:50PM (#43746439)
Quantization aware training just means having the model deal with quantized values a bit during training so it handles the quantization better when it is quantized after training/etc. It doesn't change the model size itself.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by zorgmonkey on Sunday April 20, 2025 @07:44PM (#43747386)
Both versions are quantized and should use the same amount of RAM, the difference with QAT is the quantization happens during training time and it should result in slightly better (closer to the bf16 weights) output
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by prvc on Sunday April 20, 2025 @04:16PM (#43746252)
> ~15GB (MLX) leaving plenty of memory for running other apps.

Is that small enough to run well (without thrashing) on a system with only 16GiB RAM?

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @05:14PM (#43746578)
I expect not. On my Mac at least I've found I need a bunch of GB free to have anything else running at all.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by mnoronha on Sunday April 20, 2025 @05:31PM (#43746663)
Any idea why MLX and ollama use such different amounts of ram?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by jychang on Monday April 21, 2025 @03:32AM (#43749263)
I don't think ollama is quantizing the embeddings table, which is still full FP16.

If you're using MLX, that means you're on a mac, in which case ollama actually isn't your best option. Either directly use llama.cpp if you're a power user, or use LM Studio if you want something a bit better than ollama but more user friendly than llama.cpp. (LM Studio has a GUI and is also more user friendly than ollama, but has the downsides of not being as scriptable. You win some, you lose some.)

Don't use MLX, it's not as fast/small as the best GGUFs currently. Download the LM Studio version of the Gemma 3 QAT GGUF quants, which are made by Bartowski. Google actually directly mentions Bartowski in blog post linked above (ctrl-f his name), and his models are currently the best ones to use.

https://huggingface.co/bartowski/google_gemma-3-27b-it-qat-G...

The "best Gemma 3 27b model to download" crown has taken a very roundabout path. After the initial Google release, it went from Unsloth Q4_K_M, to Google QAT Q4_0, to stduhpf Q4_0_S, to Bartowski Q4_0 now.

Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by codybontecou on Sunday April 20, 2025 @05:55PM (#43746789)
Can you run the mlx-variation of this model through Ollama so that I can interact with it in Open WebUI?
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by simonw on Sunday April 20, 2025 @06:37PM (#43747028)
I haven't tried it yet but there's an MLX project that exposes an OpenAI-compatible serving endpoint that should work with Open WebUI: https://github.com/madroidmaq/mlx-omni-server
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by codybontecou on Monday April 21, 2025 @09:49AM (#43751993)
Appreciate the link. I'll try to tinker with it later today.
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by bobjordan on Sunday April 20, 2025 @10:09PM (#43747968)
Thanks for the call out on this model! I have 42gb usable VRAM on my ancient (~10yrs old) quad-sli titan-x workstation and have been looking for a model to balance large context window with output quality. I'm able to run this model with a 56K context window and it just fits into my 42gb VRAM to run 100% GPU. The output quality is really good and 56K context window is very usable. Nice find!
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by ygreif on Monday April 21, 2025 @11:20AM (#43752951)
Do many consumer GPUs have >20 gigabytes RAM? That sounds like a lot to me
Re:Gemma 3 QAT Models: Bringing AI to Consumer GPUs by mcintyre1994 on Monday April 21, 2025 @12:53PM (#43753979)
I don't think so, but Apple's unified memory architecture makes it a possibility for people with Macbook Pros.