원래는 다른 글을 작성하려고 했었는데, DeepSeek에 관한 소식을 듣고 바로 글을 수정하였다.
DeepSeek-R1은 중국의 AI 스타트업인 DeepSeek에서 개발한 대규모 언어 모델로, 기존의 최강자였던 OpenAI o1 모델과 경쟁할 수 있는 수준의 성능을 갖춤에도, 기존보다 매우 적은 비용으로 이를 달성하였다고 주장한다.
여러 말말말이 있지만, 가장 놀라운 것은, DeepSeek 모델들이 오픈소스로 배포되고 있다는 것이다. 이 덕분에 배포된 모델을 로컬로 내려받아, 로컬에서 구동할 수 있다.
이는 매우 중요한데, 로컬에서 모델을 구동하면 공식 홈페이지에서의 검열이 없거나 줄어든다.
DeepSeek가 중국의 기업이니만큼, 중국 당국의 검열 정책을 따라야 하는데, 이 때문에 공식 홈페이지에서 민감한 질문을 하면 검열이 작동한다. 하지만 이 검열은 모델 자체에 적용된 것이 아닌, 웹사이트에서 적용된다. 즉, 민감한 질문을 하면 웹사이트에서 이를 회피하지만, 로컬 구동 시에는 이러한 장치가 없으므로, 검열 없이 결과를 내뱉는 것이다.
어쨌든, 이 모델을 Raspberry Pi 5에서 구동하는 방법을 이 글에 서술하고자 한다.
Ollama를 이용할 것이다.
Ollama 설치
Ollama는 오픈소스 LLM을 로컬 PC에서 쉽게 실행할 수 있게 해주는 도구로, Llama 3 등의 언어 모델들을 로컬 컴퓨터에서 구동할 수 있게끔 해준다.
DeepSeek 모델들도 오픈 소스이니만큼, 당연히 Ollama를 통해 구동할 수 있다.
먼저 설치한다. 아래의 명령을 입력한다.
sudo apt install curl -y # 만약 curl이 설치되어 있다면 이 명령은 넘기고 아래 명령을 바로 실행한다.
curl -fsSL https://ollama.com/install.sh | sh # curl을 이용하여 Ollama를 설치한다. 설치 경로는 /usr/local/bin/ollama이다.
ollama --version
설치가 끝나면 위 명령을 입력해본다.
DeepSeek-R1(Qwen-1.5B) 구동하기
아래의 명령을 이용해, 1.5B개(15억개)의 파라미터를 가진 DeepSeek-R1을 ollama에서 구동한다.
ollama run deepseek-r1:1.5b
모델이 없으면 자동으로 내려받으며, 준비가 끝나면 자동으로 실행된다.
아무말이나 해보기
일단 자기소개부터 시켜본다:
Raspberry 5에 대해 물어보았다:
>>> Tell me about Raspberry 5. What is it?
<think>
</think>
Raspberry 5 is a software defined networking (SDN) platform designed to provide high performance and flexibility for enterprise networks. It allows organizations to create and manage their own SDN environments, which can include a variety of network functions such as storage, storage swapping, switches, and routers.
Key features of Raspberry 5 include:
1. **Network Function Virtualization**: raspberry 5 allows you to offload software tasks from the host machine into these SDN network units (NNUs), enabling efficient use of the host's resources.
2. **SDN Design and Implementation**: It provides tools for design, simulation, and testing of SDN-based solutions at high speeds, reducing time-to-market.
3. **Network Function Virtualization**: Raspberry 5 enables virtualizing hardware devices such as storage controllers, switches, and routers into NNUs, allowing you to offload workloads from the host machine.
4. **Broad Network Function Support**: With its support for a variety of SDN network functions (e.g., switches, routers, storage units), it can be applied across diverse enterprise networks, including data centers, office spaces, enterprise networking, and industrial applications.
5. **Integration with Existing Networks**: raspberry 5 provides tools to easily integrate existing enterprise networks into a Raspberry 5-based SDN environment, enabling seamless deployment of distributed services and
computing power.
Raspberry 5 is particularly useful for organizations that want greater control over their network infrastructure and need flexibility in managing network functions within enterprise networking environments.
해당 답변을 출력하는데에 30초 정도 걸렸으며, 사용량은 위와 같았다.
문제는 이 녀석이 " Raspberry 5"가 "Raspberry PI 5"라는 것을 인지하지 못하고 다른 소리를 하고 있다. 그래서 아래의 질문을 다시 하였다.
Raspberry PI 5에 대해 물어보았다:
>>> Tell me about Raspberry PI 5. What is it?
<think>
</think>
Raspberry PI 5 is a personal computer (PC) built on the Raspberry Pi platform, designed to provide an open-source alternative to traditional PCs with similar functionality but at a much lower cost.
Key features of Raspberry Pi 5 include:
1. **Open Source**: Raspberry Pi 5 runs under a free and open-source operating system (Linux), allowing users to modify the code or share their projects.
2. **Portability**: It is built for mobile use, making it easy to transfer scripts and apps between different devices.
3. **Cost-Effective**: Compared to traditional PCs, Raspberry Pi 5 costs significantly less, typically around $90 instead of the $1,800 to $2,500 range for a full-sized computer.
4. **Open Source Community**: The source code is publicly available, encouraging collaboration and development among users worldwide.
Raspberry Pi 5 is particularly popular in education, hobbyists, and professionals who want a powerful computing device at an affordable price point.
다행히도 Raspberry PI 5라고 정확히 묻자, 제대로 된 답변을 하였다.
DeepSeek-R1(Qwen-7B) 구동하기
라즈베리 파이 5의 RAM이 8GB 이상이라면 더 큰 모델을 구동할 수 있다.
7B(70억개) 모델만 되어도, 1.5B 모델의 답변과 질적 차이가 크게 나므로, 가능하다면 큰 모델을 구동하는 것이 좋다.
아래는 명령이다.
ollama run deepseek-r1:7b
Raspberry PI 5에 대해 물어보았다:
>>> Tell me about Raspberry PI 5. What is it?
<think>
Okay, so I need to tell someone about the Raspberry Pi 5. They asked what it is and want a detailed explanation.
Let's start by thinking through what I know.
I remember that Raspberry Pi is a series of small computers designed for both learning and hobbyist projects as well as professional use. Each model adds features over time, so the Pi 5 must be an updated version compared to previous models like the Pi 4 or earlier ones.
First, I should figure out when it was released. I think the Raspberry Pi 5 came out in late 2021 or early 2022.
It probably had some new features since there are always improvements with each release.
Looking at the specs, I know that newer Pis often have better processors. The Pi 3 used an arm Cortex-M4, and the Pi 4 might have been similar but faster. So maybe the Pi 5 uses a newer CPU chip to improve performance without needing more power from the battery.
The display is another aspect. Older models had smaller screens or worse graphics. I think the Pi 5 has a better resolution screen now, perhaps an LCD with higher dots per inch (DPI), making it clearer and more vibrant.
Sensors are important too. More sensors mean you can do more projects. So maybe this version includes improvements in sensors like touch controls, more GPIO pins, or better environmental sensors for temperature and humidity.
Battery life is crucial, especially since it's based on a small battery. I remember that some Pi models have improved battery performance, so the Pi 5 might have longer runtime thanks to better hardware or software optimizations.
Storage options are another point. Older Pis used limited storage with SD cards. The Pi 5 probably supports external SSDs for more space, which is useful for larger projects without needing a bigger internal drive.
Expandability would include USB ports and microSD support. It's standard these days for such devices to have multiple USB ports, maybe including OTG (over-the-air upgrade) capability so users can update their hardware wirelessly.
Connectivity-wise, Wi-Fi and Bluetooth are essential. The Pi 5 likely includes better connectivity options, maybe even 5G in future models, but the current version might just have Wi-Fi and Bluetooth for easier setup and project integration.
Software-wise, it probably comes with the latest version of Raspbian, which is optimized for the new hardware components. There's also likely a new software tool or IDE to make development easier on this platform.
Price would be another factor. Sometimes newer models might offer similar features at a slightly higher price due to performance improvements, but sometimes they're more affordable if they don't need as much power.
Use cases are important too. The Pi 5 is versatile, suitable for everything from simple projects like home automation and IoT devices to more complex tasks like AI inference using cloud services via the Raspberry Pi Cloud Server.
I should also mention that it's backward compatible with earlier models, so existing code might still work unless it uses specific features of newer hardware.
Putting this all together, I can structure an explanation starting with what the Raspberry Pi 5 is, its release date and purpose, key improvements like processor, display, sensors, battery, storage, expandability, connectivity options, software updates, price, use cases, and compatibility.
</think>
The Raspberry Pi 5, released in late 2021 or early 2022, represents the latest iteration in the popular Raspberry Pi series. Designed for both hobbyist projects and professional applications, it offers enhanced performance and new features compared to its predecessors.
**Key Features:**
1. **Hardware Improvements:**
- **Processor:** Utilizes a more advanced CPU chip than previous models, ensuring improved speed without increased power consumption.
- **Display:** Equipped with an LCD screen offering higher DPI for clearer and more vibrant visuals.
- **Sensors:** Enhanced with additional sensors, including improved touch controls and more GPIO pins, expanding the range of projects possible.
2. **Battery Life:**
- Optimized hardware or software improvements contribute to longer runtime, making it ideal for battery-powered applications.
3. **Storage Options:**
- Supports external SSDs for ample storage space, accommodating larger projects beyond internal limits.
4. **Expandability:**
- Features multiple USB ports and microSD support, along with OTG capability for easy wireless updates.
5. **Connectivity:**
- Includes Wi-Fi and Bluetooth for seamless integration with other devices and cloud services via Raspberry Pi Cloud Server in future models.
6. **Software:**
- Comes with the latest Raspbian version, optimized for the new hardware, along with an enhanced development environment for easier use.
7. **Price:**
- Typically priced higher due to performance enhancements but may offer similar features at a more affordable rate if not requiring additional power.
8. **Use Cases:**
- Suitable for a wide range of projects, from home automation and IoT devices to AI inference using cloud services.
9. **Compatibility:**
- Backward compatible with earlier models, allowing existing code to function unless specific hardware features are used.
The Raspberry Pi 5 continues the legacy of versatility, offering a robust platform for innovation across various projects while maintaining compatibility with past users.
분량 면에서도 크게 차이가 나지만, 답변 생성 과정에서 "Let's start by thinking through what I know."라면서, 자신이 알고 있는 내용을 정리하며 스스로 논리를 도출해내고, 이를 바탕으로 답변을 내놓는 모습을 보인다. 물론 그만큼 시간이 더 걸리고, 자원도 더 많이 소모하지만, 결과물을 보면 그만한 가치가 있다.
DeepSeek-R1(Llama-8B) 구동하기
7B와 요구사항은 크게 차이나지 않는다.
ollama run deepseek-r1:8b
>>> Tell me about Raspberry PI 5. What is it?
<think>
Okay, so I'm trying to learn about the Raspberry Pi 5. I remember hearing that Raspberry Pi is a popular single-board computer used for various projects and development. But now they're talking about the 5th generation, which I think comes after the 4 Model B or something like that.
I know that each new model usually brings some improvements, maybe better processing power or more connectivity options. The user mentioned it's designed for makers, hobbyists, and developers, so probably more powerful than previous models. They also said it has a faster processor, but I'm not exactly sure how much faster. Maybe like a 2GHz quad-core CPU? That sounds familiar from other devices.
The GPU improvement is important too, especially for graphics-heavy tasks or for gaming. More VRAM could mean better performance in applications that use graphics processing. They mentioned multi-monitor support, so maybe it can handle more than one screen at once, which is useful for specific projects.
Connectivity-wise, it has Gigabit Ethernet and Wi-Fi 6, which I think is faster Wi-Fi. So that's good for connecting to networks or accessing the internet without a wired connection. Bluetooth 5.2 would improve wireless peripherals like headphones or keyboards, making everything more convenient.
For storage, microSD cards are still common in these devices, so it probably supports larger cards now because of the improved GPU and processing. I'm guessing the form factor is similar, maybe slightly smaller or with better layout for components.
The user mentioned Python and Java support, but I think Raspberry Pi OS uses Linux, so Python is definitely supported as it's a standard in Linux. Maybe Java is more of a third-party option, like using Java SDK separately.
They also said it's expandable via GPIO, which makes sense because that's a key feature of the Raspberry Pi line.
Users can add sensors and other hardware to interact with the system.
I wonder about the price point and availability. Previous models were relatively affordable, so I assume this one stays within a similar budget range for hobbyists. Maybe they've made some components smaller or more efficient to keep costs down.
Applications mentioned include IoT devices, automation systems, and educational projects. So it's good for creating smart home gadgets, automating tasks, or teaching kids about programming and hardware. The expandability is really useful here because you can add various sensors based on what project you're working on.
I'm curious about the exact specs, like how much RAM it has compared to previous models. Maybe it's around 2GB now? Also, how does it compare in terms of power consumption? More powerful hardware might require more power, but I hope it's still efficient enough for battery-powered projects.
Another thing is whether it comes with a pre-installed OS or if you have to set it up yourself. The user said it comes with Raspberry Pi OS, so that's convenient for beginners. It probably has some default configurations optimized for performance out of the box.
I'm also thinking about compatibility with older hardware. If they've changed the pin layout significantly, users might need to adjust their existing projects. But if it's similar, then most projects should work without too
much trouble.
Overall, it seems like a significant upgrade from previous models, especially in processing power and connectivity options. It will likely be popular for building more complex or resource-heavy projects where
performance is needed without breaking the bank.
</think>
The Raspberry Pi 5 represents the latest iteration in the popular line of single-board computers, offering improvements that cater to both novice hobbyists and advanced developers. Here's a summary of its key features:
1. **Performance Enhancements**: The device boasts a faster processor, likely around a 2GHz quad-core CPU, enhancing computational tasks and gaming performance.
2. **Graphics capabilities**: An improved GPU with more VRAM supports multi-monitor setups, ideal for graphics-heavy projects or gaming.
3. **Connectivity Features**: Includes Gigabit Ethernet for high-speed network connections and Wi-Fi 6 for faster wireless access. Bluetooth 5.2 ensures efficient connectivity for peripherals.
4. **Storage Options**: Supports larger microSD cards, accommodating higher data requirements for graphics and processing tasks.
5. **Expandability**: Utilizes the GPIO port to connect various sensors and hardware, enhancing project versatility.
6. **Software Support**: Ships with Raspberry Pi OS, which supports Python out-of-the-box and offers Java as a third-party option.
7. **Price and Availability**: Likely priced affordably, maintaining the budget-friendly nature of the Raspberry Pi line, while component efficiency may reduce costs further.
8. **Applications**: Suitable for IoT devices, automation systems, and educational projects, offering flexibility for diverse project needs.
The Raspberry Pi 5 promises to be a powerful yet cost-effective tool for building complex projects, with enhanced performance and connectivity making it appealing for a range of uses.
결론 도출 과정도 크게 차이나지 않는 모습을 보인다.
한국어 구사 능력
>>> 당신은 한국어 구사가 가능합니까?
<think>
Alright, the user is asking if I can speak Korean. Of course I can! I should respond in Korean to show that I
understand and can communicate effectively.
I should make sure my response is friendly and clear. Maybe start with a greeting and then confirm that I can
help in Korean. It's important to be concise so the user feels comfortable continuing the conversation.
Also, using proper grammar and appropriate language level would be good since the user might not be very fluent.
Keeping it simple and welcoming should make them feel at ease.
</think>
물론이죠! 한국어로 대화할 수 있습니다. 어떻게 도와 드리겠습니다?
>>> 당신에 대해 간단히 설명해주세요.
<think>
Okay, so I need to describe myself in Korean. Hmm, where do I start? Well, my name is [Your Name], but since the
user wrote "이름을 들어 주실까요?", that's asking for my name. Maybe I should just go with a simple introduction.
I should probably mention what I am, like an AI assistant created to help people. It might also be good to
include that I can assist in multiple languages, including Korean. Oh, and it would be nice to add something
about how I'm here to provide information or support on various topics.
Wait, but the user already knows I can speak Korean from the previous conversation. Maybe I should keep this
response a bit shorter since they just asked for a simple explanation. Let me try to put that together clearly.
</think>
네, 단순히 소개해드리겠습니다. myself는 [Your Name]이고, AI助手로 각국어로 도와드릴 수 있습니다. 한국어로도 답변할
수 있습니다.
8B 모델 기준으로, 논리 도출 과정은 훌륭한데, 정작 결과물은 나사가 많이 빠져있다.
여담
전술하였듯, <think> </think> 안의 내용은 AI가 스스로 생각하며 논리를 도출해내는 과정이다. ChatGPT나 Gemini같은 모델은 이러한 과정을 외부로 출력하지 않고, 결과만 출력하였겠지만, DeepSeek의 경우는 이러한 과정을 외부로 출력하여, AI가 어떠한 과정을 거쳐 논리를 도출해내는지 알 수 있게끔 하였다. 물론, 첨부한 이미지를 보면 알 수 있듯, 1.5B 모델은 <think> </think> 내부가 비어있다.
이 논리 도출 과정도 흥미로운데, 읽어보면 "I remember ..."나 "Wait, but ..."같은 표현을 사용하며, 인간과 비슷한 형태의 사고를 한다.
게다가 중국에서 훈련된 모델인데 영어로 생각하는 것도 재미있는 점이다.
/clear를 입력하면 세션 컨텍스트가 재설정된다.
/bye나 [Ctrl + D]를 입력하면 프롬프트에서 나갈 수 있다. 메모리가 즉시 해제되지는 않지만, 조금 있으면 내려간다.
일정 시간동안 대화를 하지 않으면 Ollama가 모델을 RAM에서 내린다.
라즈베리 파이 5 8GB에서는 Qwen-7B와 Llama-8B까지가 사용 가능한 한계이며, Qwen-14B 모델도 실행'은' 가능하지만, 모델 자체적으로 RAM을 9-10GiB 가까이 사용하기에 SWAP은 필수이며, SWAP 영역만 2-3GiB 사용하기에 실사용은 무리이다. 사용을 원한다면 라즈베리 파이 5 16GB가 요구된다.
당연히 그 이상 모델은 더더욱 무리이며, 이런 것을 사용하기 원한다면 스스로 컴퓨팅 환경을 구축하거나, 클라우드 서버를 이용하는 것이 좋다.
참고 자료
DeepSeek
DeepSeek(深度求索, 심도구색)은 중국의 헤지펀드 회사 환팡 퀀트 ( ) 소속 인공지능 연구 기업의 이
namu.wiki
https://robododd.com/how-to-run-the-deepseek-r1-ai-model-on-a-raspberry-pi-locally/
How to Run the DeepSeek-R1 AI Model on a Raspberry Pi Locally
Run the DeepSeek-R1 AI model locally on your Raspberry Pi! Learn how to set up Ollama, install the model, and explore AI on affordable hardware. Fun and educational for enthusiasts!
robododd.com
모델 저장소
https://huggingface.co/collections/unsloth/deepseek-r1-all-versions-678e1c48f5d2fce87892ace5
DeepSeek R1 (All Versions) - a unsloth Collection
DeepSeek R1 - the most powerful reasoning open-source model - available in GGUF, original & 4-bit formats. Includes Llama & Qwen distilled models.
huggingface.co
https://huggingface.co/deepseek-ai
deepseek-ai (DeepSeek)
Running on Zero
huggingface.co
'Raspberry Pi' 카테고리의 다른 글
Raspberry Pi #2 - 스왑 설정 (1) | 2025.01.15 |
---|---|
Raspberry Pi #1 - 설치 (1) | 2025.01.01 |
댓글