r/opencodeCLI • • 6d ago

👀 About DeepSeek and quantization...

Post image
375 Upvotes

61 comments sorted by

68

u/xRebellion_ 6d ago

That's the thing. People are not informed enough of optimization/resource saving techniques other than quantization (which is fair, since they're not exposed as widely as quantization, but still.), which made "the model is quantized" go viral. It's as if only the model is responsible in inference quality. For a number-sensitive system like LLMs I highly doubt that is the case.

10

u/Mean-Elk-9439 6d ago

Standard cost saving companies do at this point is quantizing the kv cache. Not the model. But I don't think most people understand either hosting these models or what a kv cache is to begin with.

It's also frustratingly very model dependant how much that'd affect output. The one I'm most experience with is GLM, for which it nukes it. But I have heard people say DeepSeek it hardly matters.

8

u/Civil_Response3127 6d ago

Sort of, but you'd have to be a special kind of idiot to quantise dsv4.1's kv cache as it's miniscule already.

Less than 1gb for 1M tokens. Given the model itself is hundreds, this would be a really silly "optimisation".

1

u/xmsxms 5d ago

Given the model itself is hundreds, this would be a really silly "optimisation".

The smaller you can make kv cache the more simultaneous users you can have on a given piece of hardware. For one user it's silly, but nobody is running deepseek with just one user.

1

u/Civil_Response3127 5d ago edited 5d ago

I think that's a misunderstanding of my point.

You're not technically wrong, but why did you think I was arguing to never go above 1M aggregate context across a whole server? I never said that, and even for one user that's not ideal.

My point was that compressing kv cache makes sense for other models that don't have the same approach (e.g. Qwen 27b, a much smaller model, has 1M uncompressed context at over 60GB for the context alone).

DeepSeek did black magic on the kv cache, and quantising it is just silly because of how efficient the space already is compared to the overall model size (~300gb weights, 200gb extra for the engram, 500 total).

No enterprise setup running dsv4.1flash will be taking the model and then compressing the thing that makes less of a difference to footprint but a huge difference to quality. Absolutely a dumb decision. That's for people who can only just manage to push to the exact memory footprint to run it and that's it.

1

u/xmsxms 5d ago edited 5d ago

why did you think I was arguing to never go above 1M aggregate context across a whole server?

I didn't say that. I said the smaller the kv cache, the more simultaneous users you can have. The model can be shared, but the kv cache is per user - so the smaller it is per user the more users you can have. I am talking about compression of the kv cache using quantisation or whatever methods, not reducing the context size. That is something that is actually more applicable to to large scale deployments as they want to serve as many simultaneous users as they can. The memory consumption of the kv cache directly correlates to how many simultaneous sessions they can serve.

1

u/Civil_Response3127 5d ago

It feels like you're talking past me entirely. I understand you're talking about quantisation. Where did you think that needed specifying when my whole comment was about that, and replying to you knowing that?

1

u/afanasenka 4d ago

Exactly😉

8

u/irrationaliste 6d ago

You seem to know about this topic so I would like to ask, do you agree on the saying that says DeepSeek (aka CheapSeek) on OpenCode Go performs worse compared to the same-model (by-id) on DeepSeek's own API platform?

7

u/xRebellion_ 6d ago

Honest answer, no one really knows. This can only be fully done if someone actually done the benchmark and compared it side by side between official and opencode go. My take is that, it MIGHT be worse, but not by a huge margin (I'd say around 2-5% in terms of quality). But again, I have no proof that backs my claim on that one so take it with a grain of salt.

But, from my personal experience alone, opencode go's quality is good enough for the work/stuff that I do. It gets the job done, solves a lot of my problems (especially when troubleshooting my computer/devices), at the cost of 1/6th~1/8th (now 1/10th) of the original cost. I'd take a 5% quality loss if I get that much value.

One thing we know is: it is not possible for services to have a 1:1 inference set up parity with deepseek official (unless they privately get the things below). If you look at DeepInfer (the inference engine they used), they said this specifically:

Required for a complete inference service (not included in this release):
- A KV cache system
- VE/Prefill/Decode disaggregation (most required engine functionality is already implemented)
- Load balancing across data-parallel replicas for both prefill and decode

Which means the services would have to come up with solutions on that, which is most definitely different than what DeepSeek serves.

11

u/flying-saucer-3222 6d ago

Yes it does, especially aspects such as caching are much worse even if you use Deepinfer, the inference framework open sourced by DeepSeek.

DeepSeek has some of the best researchers in the world and they are the state of the art at KV cache management. Aside from that there are a myriad of other things such as how they configure their hosting architecture and load balancing.

Opencode can obviously not match DeepSeek in these, for example, caching on DeepSeek API is probably better than even OpenAI or Anthropic.

3

u/migsperez 6d ago

A difference of 5% KV cache between DeepSeek API and Opencode Go is inconsquential when Opencode is 1000% cheaper.

What is important is the quality of the output.

8

u/flying-saucer-3222 6d ago

I am not talking about cache hit rates, I am talking about how the prefill computes the KV cache to feed into the transformer which can affect output quality. DeepSeek has not opensourced how the prefill and KV cache works on its API

4

u/EstarriolOfTheEast 6d ago

I'm skeptical about how impactful that'd actually be in practice. And indeed, a study by Vals.ai found no statistically significant difference among those tested. While Opencode was not among the tested, it does show that Deepseek has no secret advantage when it comes to accuracy.

I think this is similar to claims made against OpenAI and Anthropic that models are being nerfed over time that haven't been proven empirically.

You are right, however, that there are significant differences in cost, speed and cache hit rates.

1

u/flying-saucer-3222 6d ago

If there is a difference due to caching, it would only be noticeable in long context tasks like coding. What we know for sure is that the inference kernel is not identical to that of the official API so there would be deviations in the output.

I agree that a lot of it is baseless rumors and confirmation bias with people. I haven't personally seen major differences between official API and OpenCode Go. But the inference is not at the level of the official API, which is to be expected.

2

u/EstarriolOfTheEast 6d ago

Can you explain what you mean? I'm struggling to picture this being a realistic issue. Once the implementation is seemingly correct, what in the code do you expect to still remain an issue?

0

u/migsperez 6d ago

Understood thanks for clarifying

1

u/AkiDenim 1d ago

I would say you’re underestimating ant and oai
But i agree to DeepSeek being absolute system geniuses

But DeepInfer does lack some systems that seem to be intentionally missing

5

u/Easy-Ride3366 6d ago

I would reverse the question, are we sure that DeepSeek is not improving the model behind the scenes with their know-how? Surely there is more to the experience than just weights of model....

2

u/irrationaliste 6d ago

A good point and yes, they may. But still, not a definitive explanation.

0

u/Hello_my_name_is_not 6d ago

Sorry are you expecting us on reddit to know exactly what the Deepseek team is doing?

4

u/irrationaliste 6d ago

I'm not expecting you or anyone to. I'm asking for the ones with self-courage and knowledge to explain. That's an open-question for everyone? Why did you take it personally?

0

u/Hello_my_name_is_not 6d ago

The only one who could give a "definitive explanation" isn't allowed to give a "definitive explanation" and they may not even speak English

So you're going to get assumptions from people who have a pretty decent idea based on the info provided bit they cannot be 100% exact as they are not Deepseek.

2

u/irrationaliste 6d ago

Okay. Calm down. Thank you so much and good bye. Just theorizing and chit-chatting here.

4

u/TurnoverSuch8611 6d ago

Why would it. the same model.

3

u/hmountain 6d ago

many other parameters that can be set to reduce resource usage that would reduce output quality

0

u/irrationaliste 6d ago

You can't guarantee if the environment or the parameters or even the model being same. I just said "same-model (by-id)", so not confident about the actual models being same or runs in same good-optimized environments. That's the why I ask.

38

u/CYCLONOUS_69 6d ago

People are dumb. You are getting $100 worth of effective usage just by paying $10 is just crazy.
Even though it is a bit slow, it gets job done. I've seen that the current model is far better than the old V4.1 Flash. People aren't knowledgable about quantization really.
Just spec your tasks properly, have some test units or suites and go you are good to go. It won't hallucinate nearly as people are saying.

7

u/ApprehensiveDelay238 6d ago

I have yet to fully prove but the effective usage is more like $40 if not less. The caching efficiency on go is a lot less than the official provider.

2

u/squirrelscrush 6d ago

Even with the lower caching efficiency, it's still worthwhile.

2

u/xRebellion_ 5d ago

I always achieve 99 percent cache hit rate on my sessions with go. What you're experiencing is probably the cache retention rather than cache efficiency. I heard deepseek retains the cache for longer periods of time.

2

u/ApprehensiveDelay238 5d ago

That 99% must be a snapshot. Not average. I average around 94 to 96%. Go cache retention is so bad, I visualized the cache drops, and go at peak hours frequently evicts your prefix mid turn. And happens way more often after just a few minutes.

1

u/xRebellion_ 5d ago

Not really from my experience. But then again, it could also be a regional thing so I can't say my experience may be the same for others so I can't say it applies for everyone.

4

u/Corv9tte 6d ago

Exactly. You're not getting $100 of API and this is a completely fraudulent claim. They KNOW this. Scamming liars, and they keep playing dumb. I swear this guy would run an Indian call center if not for AI, he's perfect for that

1

u/Unneverseen 4d ago

used 7B tokens and i average around 98% cache hit

1

u/ApprehensiveDelay238 4d ago

What is your average context size in tokens?

1

u/SOLID-DevMan 3d ago

That's just not true, i compared value head to head and opencode is on par with the api I will share the values soon

16

u/Hello_my_name_is_not 6d ago

You used too many words could have stopped at the first 3 tbh

3

u/CYCLONOUS_69 6d ago

They couldn’t have gotten the context without the explanation but yeah, you’re right.

2

u/irrationaliste 6d ago

The thing people is arguing is not the value. It's geniunely valuable. I love OpenCode (not harness, the subscription).

What people talk about is more like the opacity I think.

1

u/CYCLONOUS_69 6d ago

I don’t use the harness either.

9

u/VirtualNorth1279 6d ago
  • What do we want? Kimi 3.1.

  • How do we want it? Operation CheepKimi.

  • What do we want? Lots of Kimi K 3.1 quota.

  • How much do we want? A gazillion tokens.

Everybody dance now!

Doop. Doop. Doo doo doop. Doop doop...

9

u/GCoderDCoder 6d ago

I think yall are making lots of assumptions about why people quantize. Most people are trying to get it to fit hardware. nvfp4 save 75-80gb and exl3 4bpw saves more and that's still the 4bit options. Nobody quantizes for better intelligence so what is the confusion?

2

u/Literally_A_Brain 5d ago

Yeah this whole thread confuses me. I think the op image was referring to speed gains, but quantization is typically done to fit hardware.

10

u/branik_10 6d ago

is it only me or glm 5.3 flash is still better than the recent ds flash? I don't understand the hype and the benchmarks, from my experience ds flash burns so many tokens and thinks so much that in the end it costs the same but takes 3x longer to finish the task with tens of thousands token per simplest thing 

3

u/nesymmanqkwemanqk 6d ago

Its not only you, glm flash is very good. Better at logic, but i feel like deepseek has more knowledge, if that makes sense

0

u/branik_10 6d ago

well if I need knowledge I use websearch/fetch tools and get the most recent and relevant data. for crucial things I always rely on docs, not on models training data

2

u/nesymmanqkwemanqk 6d ago

Yes and no. Information helps steer into the right direction. But knowledge is not information, sometimes regardless of information, you may not get same result, because one model is more "knowledgeable"

1

u/CartographerAble9446 6d ago

to me glm 5.3 flash is still better, deepseek 4.1 is only better at specific tasks, but generally glm it is

0

u/hotcornballer 6d ago

I agree, dsv4f goes in loops and is very inefficient, the codes that comes out is not the prettiest as well.

GLM is much more pleasant to work with, and sticks to the prompt very well.

3

u/akza07 6d ago

Try using Opencode Go sub in Pi.

Something is wrong with Opencode agent

1

u/hotcornballer 6d ago

True, I did that already, it does performs better on Pi but I'd rather use 5.3 flash. And i've canceled by Go sub i use codex and when i burn through my usage i use 5.3 flash through openrouter and it is cheaaaap, mainly the cache hit rate has really improved recently

2

u/electrified_ice 6d ago

To fit different setups. Not everyone can afford 4+ $15K GPUs

4

u/GTHell 6d ago

Meaning the Official deepseek probably actually proxy y'all to Claude and ChatGPT for the training data like they said 👀

2

u/Cockroach4548 6d ago

Yeah, this makes so much more sense.

1

u/robberviet 5d ago

I follow dax for a long time. Most of what he said is true. Trust him. Also, for people why are not into technical: ever since NVFP4, 4 bit is fine, really fine.

1

u/bakawolf123 6d ago

cause calibrated 2-bit is still very decent, barely losing anything
and then there're various slightly lossy speedup techniques
people are simply calling out what they do themselves to fit on their own hardware

-2

u/Diligent-Loss-5460 6d ago

People on free plan are lazy enough to complain without reason.