Ollama로 DeepSeek-R1 70B 실행하기

Ollama로 DeepSeek-R1 70B 실행하기

온디맨드 인스턴스 하나에서 Ollama를 띄워 DeepSeek-R1을 실행하는 건 생각보다 간단해요. 이 짧은 튜토리얼은 Lambda Cloud 온디맨드 인스턴스에서 Docker 컨테이너 안의 Ollama로 DeepSeek-R1 디스틸 Llama 3.3 70B 모델을 실행하는 방법을 알려줘요.

모든 온디맨드 인스턴스에는 NVIDIA Container ToolkitLambda Stack의 일부로 미리 설치돼 있어서, Docker 컨테이너가 추가 설정 없이 인스턴스 GPU를 쓸 수 있어요. 그래서 명령 몇 줄만으로 모델 서버를 띄우고 대화를 시작할 수 있죠.

출처: Running DeepSeek-R1 70B using Ollama - Lambda Docs

준비 사항

이 튜토리얼에서는 40GB 이상의 VRAM을 가진 인스턴스 타입을 권장해요. 예를 들어 1x GH200 또는 1x H100이에요.

Ollama 내려받고 서버 시작하기

  1. SSH나 Jupyter Lab의 터미널로 인스턴스에 로그인해요.
  2. Ollama를 내려받고 서버를 시작해요.
sudo docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

아래 메시지가 보이면 내려받기가 끝난 거예요.

Status: Downloaded newer image for ollama/ollama:latest
  1. Ollama 서버가 실행 중인지 확인해요.
sudo docker ps

다음과 비슷한 출력이 보여요.

CONTAINER ID   IMAGE           COMMAND               CREATED       STATUS       PORTS                                           NAMES
3b27fdfbbfcc   ollama/ollama   "/bin/ollama serve"   2 hours ago   Up 2 hours   0.0.0.0:11434->11434/tcp, :::11434->11434/tcp   ollama

DeepSeek-R1 70B 모델 내려받고 실행하기

DeepSeek-R1 70B 모델을 내려받고 실행해요.

sudo docker exec -it ollama ollama run deepseek-r1:70b

모델은 40GB가 넘어 내려받는 데 10~15분이 걸릴 수 있어요. 아래처럼 나오면 모델이 실행 중인 거예요.

success
>>> Send a message (/? for help)

DeepSeek-R1 70B 모델 테스트

DeepSeek-R1 70B 모델에 프롬프트를 넣어 테스트해요.

What is the national anthem of France?

DeepSeek-R1은 추론을 먼저 하고 답하는 모델이라, 답변 전에 thinking 블록으로 내적 사고 과정을 보여줘요. 최종 답변은 다음과 같이 나와요.

The national anthem of France is **"La Marseillaise."** It is a patriotic song with origins in the French Revolution, known for its stirring melody and lyrics that call for unity and action. Adopted as the official anthem, it reflects the country's history and identity.

더 알아보기