Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • U unicoc
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 126
    • Issues 126
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Adell Collier
  • unicoc
  • Issues
  • #116

Closed
Open
Created Mar 03, 2025 by Adell Collier@adell628893828Maintainer

Run DeepSeek R1 Locally - with all 671 Billion Parameters


Recently, I demonstrated how to quickly run distilled versions of the DeepSeek R1 design in your area. A distilled design is a compressed version of a larger language model, where knowledge from a bigger design is moved to a smaller one to reduce resource use without losing excessive efficiency. These models are based upon the Llama and Qwen architectures and be available in variations ranging from 1.5 to 70 billion parameters.

Some explained that this is not the REAL DeepSeek R1 which it is impossible to run the full design locally without a number of hundred GB of memory. That sounded like a difficulty - I thought! First Attempt - Warming up with a 1.58 bit Quantized Version of DeepSeek R1 671b in Ollama.cpp

The developers behind Unsloth dynamically quantized DeepSeek R1 so that it could operate on just 130GB while still gaining from all 671 billion parameters.

A quantized LLM is a LLM whose specifications are saved in lower-precision formats (e.g., 8-bit or 4-bit instead of 16-bit). This significantly reduces memory use and accelerates processing, with very little effect on performance. The full variation of DeepSeek R1 utilizes 16 bit.

The trade-off in accuracy is hopefully compensated by increased speed.

I downloaded the files from this collection on Hugging Face and ran the following command with Llama.cpp.

The following table from Unsloth reveals the recommended value for the n-gpu-layers criterion, which shows just how much work can be offloaded to the GPU.

According to the table, I thought 7 need to be the optimum, but I got it running with 12. According to Windows Task Manager my GPU has 40 GB of memory, and not 24 as I believed. So then it builds up (7/ 24 * 40 ≈ 12).

If you choose to run the design straight with Ollama, you should merge the three GGUF files utilizing Llama.cpp or a similar tool first.

Above is some of the text that appears on screen while running the command.

Llama.cpp and the quantized design are heavy on memory and CPU, but likewise utilize the GPU (a little) and continually check out from the disk where the design files are kept.

The model repeats the concern and is preparing yourself to begin thinking.

The thinking, or thinking, is quite lengthy - which likewise contributes to the total time it takes.

Okay, so I require to figure out Alan Turing's crucial contribution to how we live our lives in 2025. Hmm. Let's start by remembering who Alan Turing was. He was a British mathematician and computer scientist, right? He's understood for his operate in code-breaking during World War II, especially with the Enigma machine. Oh, and he's also considered one of the dads of theoretical computer system science and expert system.

So, his contributions ... Well, the Turing Machine idea is fundamental in computer science. It's a theoretical design of a computer, which laid the groundwork for modern-day computing. Then there's the Turing Test, which has to do with figuring out whether a maker can show smart habits indistinguishable from a human. That's associated to AI. Also, his work on morphogenesis, funsilo.date which I think has to do with biological patterns and development, like how organisms establish shapes and patterns.

Now, how do these contributions impact life in 2025? Well, we remain in a world where AI is ending up being more widespread. So maybe his deal with the Turing Test is influencing how AI is developed and integrated into society. If the Turing Test is a standard for AI intelligence, then advancements in AI that pass this test may be considerable. But wait, the Turing Test is more of a philosophical criteria. Maybe the real algorithms or principles he developed are more fundamental.

The Turing Machine model is the basis for the stored-program computer system, which is the architecture of modern-day computer systems. All our computers today, consisting of smartphones, servers, and so on, are based upon this idea. So, in 2025, even as innovation advances, the basic concepts he laid down would still be the basis for all computational devices. That's pretty big. Without that, we would not have the computer systems that power whatever from the internet to AI algorithms.

Additionally, his deal with code-breaking throughout WWII resulted in improvements in cryptography. Modern file encryption methods may have roots in his work, which is essential for protected communication in 2025. Everything from online banking to personal messaging depends on file encryption, so that's a huge contribution.

Another angle is his influence on the advancement of algorithms. The principle of a universal computing maker enables the production of complicated algorithms that drive AI, data analysis, artificial intelligence, etc. So, any AI systems in 2025 would stem from his foundational work.

Also, morphogenesis may have influenced fields like biology and genetics. Maybe in 2025, understanding biological patterns assists in areas like genetic engineering or synthetic biology. But I'm uncertain how straight that ties into daily life compared to computing.

Putting all of it together, the most crucial contribution may be the Turing Machine and the theory of calculation, which underpin all modern computing innovation. Without that, the digital age wouldn't exist as we understand it. In 2025, even with developments, the basic structure of computation he supplied would still be necessary. Alternatively, his deal with AI and the Turing Test might be more highlighted in an AI-driven future, however the foundational computing theory appears more essential.

Wait, however the Turing Test is more about evaluating AI instead of a contribution to technology itself. The genuine contribution is the theoretical basis for computing, which allowed all the digital tech we have. So, in 2025, all the wise devices, AI, cloud computing, etc, are all built on the principles he developed. Therefore, his most essential contribution is the principle of a universal Turing maker, which is the basis for all modern-day computers, resulting in the digital transformation that defines modern life.

And finally the answer.

Alan Turing's most considerable contribution to how we live in 2025 is his foundational work in theoretical computer technology, particularly the concept of the universal Turing device. This theoretical model established the concepts of contemporary calculation, the basis for all digital computers. In 2025, this innovation underpins the whole digital world, allowing technologies like expert system, cloud computing, mobile phones, and the internet. Without Turing's conceptual structure, the development of programmable computers and subsequent innovations that define contemporary life-from AI algorithms to secure communication systems-would not have actually been possible. His work on cryptography and the Turing Test also contributed to secure interactions and AI advancement, however it is the universal Turing machine that remains the foundation of our digital existence.

In summary: The 1.58 bit quantized design generated 0.39 tokens per second. In overall, it took about 37 minutes to address the same question.

I was type of stunned that I was able to run the model with only 32GB of RAM.

Second Attempt - DeepSeek R1 671b in Ollama

Ok, I get it, a quantized design of just 130GB isn't truly the complete model. Ollama's design library seem to consist of a full variation of DeepSeek R1. It's 404GB with all 671 billion criteria - that should be genuine enough, right?

No, not truly! The version hosted in Ollamas library is the 4 bit quantized variation. See Q4_K_M in the screenshot above? It took me a while!

With Ollama set up on my home PC, I just required to clear 404GB of disk area and run the following command while getting a cup of coffee:

Okay, it took more than one coffee before the download was total.

But lastly, the download was done, and the enjoyment grew ... till this message appeared!

After a quick check out to an online store selling various types of memory, I concluded that my motherboard wouldn't support such large amounts of RAM anyway. But there must be alternatives?

Windows enables for virtual memory, implying you can swap disk area for virtual (and rather slow) memory. I figured 450GB of extra virtual memory, in addition to my 32GB of genuine RAM, must be enough.

Note: Understand that SSDs have a minimal variety of write operations per memory cell before they break. Avoid extreme usage of virtual memory if this issues you.

A new attempt, and rising excitement ... before another mistake message!

This time, Ollama tried to push more of the Chinese language design into the GPU's memory than it could handle. After browsing online, it seems this is a known problem, however the solution is to let the GPU rest and let the CPU do all the work.

Ollama uses a "Modelfile" containing setup for the model and how it ought to be utilized. When utilizing designs straight from Ollama's model library, you generally don't handle these files as you must when downloading designs from Hugging Face or comparable sources.

I ran the following command to show the existing setup for DeepSeek R1:

Then, I added the following line to the output and waited in a new file named Modelfile:

I then produced a new model setup with the following command, where the last parameter is my name for the design, which now runs totally without GPU use:

Once again, the enjoyment grew as I nervously typed the following command:

Suddenly, it took place! No error message, but tokens began appearing! Admittedly, the speed was such that if you fasted enough, you might practically grab a coffee in between each screen update - however it was working! A language model on par with the best from OpenAI, with all its 671 billion specifications, working on my three-year-old PC with 32GB (genuine) RAM!

I had actually asked the exact same question to both ChatGPT (4o, o1, 03-mini-high), DeepSeek R1 hosted in China and DeepSeek R1 671b hosted locally.

This is the reasoning from DeepSeek R1 running in Ollama on my own computer, as it appeared slowly-token by token.

And finally this is the response from DeepSeek R1 running in Ollama. The model outputs the response with markdown formatting.

Alan Turing's most substantial contribution to modern life, especially as we look towards 2025, depends on his foundational work on computational theory and expert system, which underpin almost every element of modern-day innovation. Here's a structured breakdown:

1. Universal Turing Machine (1936 ):

- This conceptual model for general-purpose computing is the bedrock of all digital innovation today. It developed that a single maker might execute any computable task with the right program, enabling: Modern Computing Devices (mobile phones, cloud infrastructure, IoT). Software Development, allowing flexible applications throughout industries.

2. In 2025, advancements in quantum computing, AI, and edge computing still rely on Turing's principles of programmable reasoning.

3. Artificial Intelligence & the Turing Test (1950 ):

- His structure for evaluating maker intelligence spurred decades of research into human-like AI. By 2025, this tradition is obvious in: - Advanced chatbots, virtual assistants (e.g., GPT-4/ 5), and self-governing systems.

  • Ethical disputes around AI decision-making in healthcare, finance, and law.

    4. Cryptography & Security:

    - Turing's WWII codebreaking work foreshadowed modern file encryption strategies important for: - Securing digital deals, personal data, and blockchain technologies.
  • Combating cyber threats in an increasingly linked world.

    Why the Universal Machine Sticks Out: While AI and cryptography are transformative, Turing's theoretical design of calculation is the most basic. It enabled the production of programmable systems that drive today's innovations-from AI algorithms to quantum computing research study. Without this structure, the digital facilities of 2025 just would not exist.

    So, how long did it take, utilizing the 4 bit quantized design? Quite a while! At 0.05 tokens per 2nd - implying 20 seconds per token - it took nearly 7 hours to get a response to my concern, consisting of 35 minutes to load the design.

    While the model was thinking, the CPU, memory, and the disk (utilized as virtual memory) were close to 100% hectic. The disk where the model file was conserved was not busy throughout generation of the action.

    After some reflection, I thought maybe it's alright to wait a bit? Maybe we should not ask language models about everything all the time? Perhaps we must think for ourselves initially and want to wait for an answer.

    This might look like how computers were used in the 1960s when devices were large and availability was really restricted. You prepared your program on a stack of punch cards, which an operator loaded into the device when it was your turn, and you might (if you were lucky) get the result the next day - unless there was an error in your program.

    Compared to the action from other LLMs with and without reasoning

    DeepSeek R1, hosted in China, thinks for 27 seconds before offering this answer, which is a little much shorter than my in your area hosted DeepSeek R1's action.

    ChatGPT answers likewise to DeepSeek but in a much shorter format, with each design offering somewhat different actions. The reasoning designs from OpenAI spend less time reasoning than DeepSeek.

    That's it - it's certainly possible to run different quantized variations of DeepSeek R1 in your area, with all 671 billion parameters - on a three years of age computer with 32GB of RAM - just as long as you're not in too much of a hurry!

    If you truly desire the full, non-quantized variation of DeepSeek R1 you can discover it at Hugging Face. Please let me understand your tokens/s (or rather seconds/token) or you get it running!
Assignee
Assign to
Time tracking