試玩本地DeepSeek:手提電腦搞得掂!

Ai




我在我的筆記本電腦上本地運行DeepSeek的經驗:過程分享

人工智能

作者:Raghav Sethi
發表時間:2小時前

運行一個本地的AI聊天機器人聽起來很吸引,但通常需要強大的、昂貴的硬件。然而,這並不總是如此:DeepSeek的R1模型是一個適合低性能設備的有用選擇,並且安裝起來也意外地簡單。

本地運行AI聊天機器人的意義

當你使用像ChatGPT這樣的在線AI聊天機器人時,你的請求是在OpenAI的伺服器上處理,這意味著你的設備並不需要進行繁重的計算。你需要持續的互聯網連接來與AI聊天機器人進行交流,並且你永遠無法完全控制自己的數據。驅動AI聊天機器人的大型語言模型,如ChatGPT、Gemini、Claude等,運行需求非常高,因為它們依賴擁有大量VRAM的GPU。這就是為什麼大多數AI模型都是基於雲的原因。

本地的AI聊天機器人直接安裝在你的設備上,就像其他軟件一樣。這意味著你在使用AI聊天機器人時不需要持續的互聯網連接,可以隨時發送請求。DeepSeek-R1是一個可以在多種設備上安裝的本地LLM。它的精簡版7B模型(七十億參數)是一個較小的優化版本,能夠在中端硬件上良好運行,讓我可以生成AI回應,而不需要雲端處理。簡而言之,這意味著更快的回應、更好的隱私和對自己數據的完全控制。

如何在我的筆記本電腦上安裝DeepSeek-R1

在你的設備上運行DeepSeek-R1相當簡單,但請記住,你使用的是一個較弱的版本,與DeepSeek的網絡AI聊天機器人相比,後者使用大約6710億參數,而DeepSeek-R1只有約70億。

你可以按照以下步驟在電腦上下載並使用DeepSeek-R1:

1. 前往Ollama的網站,下載最新版本。然後像其他應用程序一樣安裝在你的設備上。
2. 打開終端,輸入以下命令:
“`
ollama run deepseek-r1:7b
“`

這將把7B DeepSeek-R1模型下載到你的電腦上,讓你可以在終端中輸入查詢並接收回應。如果你遇到性能問題或崩潰,可以通過將上述命令中的7b替換為1.5b來嘗試使用較少要求的模型。

雖然這個模型在終端中運行得相當好,但如果你希望有一個完整功能的用戶界面,並且有正確的文本格式,如ChatGPT,你也可以使用像Chatbox這樣的應用程序。

本地運行DeepSeek並不完美——但它有效

如前所述,DeepSeek-R1的回應不會像DeepSeek的在線AI聊天機器人那樣好(或快!),因為它使用的是更強大的模型並且所有處理都在雲端完成。但讓我們來看看這些較小模型的表現。

解決數學問題

為了測試7B參數模型的性能,我給它一個方程,讓它求解其積分。對於它的表現我感到相當滿意,特別是因為基本模型通常在數學上表現不佳。

我承認這不是最複雜的問題,但這正是本地運行LLM如此有用的原因。它的意義在於隨時可以處理簡單查詢,而不需要完全依賴雲端。

調試代碼

我發現本地運行DeepSeek-R1的最佳用途之一是幫助我的AI項目。這尤其有用,因為我經常在沒有互聯網連接的航班上編寫代碼,而我在調試時非常依賴LLM。為了測試它的效果,我給它這段故意添加了錯誤的代碼。

“`python
X = np.array([1, 2, 3, 4, 5]).reshape(-1, 1)
y = np.array([2, 4, 6, 8, 10])

model = LinearRegression()
model.fit(X, y)

new_X = np.array([6, 7, 8])
prediction = model.predict(new_X)
“`

它毫不費力地處理了這段代碼,但請記住,我是在一台只有8GB統一內存的M1 MacBook Air上運行這段代碼的。(統一內存在CPU、GPU和其他系統組件之間共享。)

當我打開一個IDE並運行幾個瀏覽器標籤時,我的MacBook性能下降嚴重——我不得不強制關閉所有程序以使其恢復響應。如果你有16GB RAM或甚至中階GPU,你可能不會遇到這些問題。

我還測試了更大的代碼庫,但它陷入了思考迴圈,因此我不會依賴它完全取代更強大的模型。不過,它仍然對快速生成小代碼片段非常有用。

解決謎題

我也很好奇這個模型如何處理謎題和邏輯推理,因此我用Monty Hall問題進行了測試,它輕鬆解決了這個問題,但我開始欣賞DeepSeek的另一個原因。

如截圖所示,它不僅給出答案——它還逐步向你解釋整個思考過程,說明它是如何得出這個解決方案的。這清楚地表明它是在推理問題,而不僅僅是從訓練數據中回憶一個記憶的答案。

研究工作

本地運行LLM的一個最大缺點是其知識截止日期過時。由於它無法訪問互聯網,找到可靠的近期信息可能會很具挑戰性。這一限制在我的測試中顯而易見,但當我請求關於原始iPhone的簡要概述時,情況變得更糟——它生成的回答既不準確又無意中搞笑。

顯然,第一部iPhone並沒有搭載iOS 5,也不是在不存在的“iPhone 3”之後推出的。幾乎所有的內容都是錯誤的。我用幾個其他基本問題進行了測試,但不準確的情況依然存在。

在DeepSeek遭遇數據洩露後,知道我可以本地運行這個模型而不必擔心我的數據被曝光讓我感到安慰。雖然它並不完美,但擁有一個離線的AI助手是一個巨大的優勢。我希望看到更多像這樣的模型集成到消費設備中,比如智能手機,特別是在我對Apple Intelligence感到失望之後。

在這篇文章中,作者深入探討了本地運行AI模型的優缺點,特別是DeepSeek-R1的實用性。值得注意的是,雖然本地運行的模型在某些方面(如數學問題解決和代碼調試)表現出色,但在處理複雜問題和保持信息更新方面卻存在明顯的局限性。這提醒我們,倘若希望在日常生活中獲得更可靠的AI助手,仍需繼續推進技術的發展,並期待未來更多本地運行的AI應用出現,以滿足用戶需求。

以上文章由特價GPT API KEY所翻譯及撰寫。而圖片則由FLUX根據內容自動生成。

🎨 Nano Banana Pro 圖像生成器|打幾句說話就出圖

想畫人像、產品圖、插畫?SSFuture 圖像生成器支援 Flux Gemini Nano Banana Pro 改圖 / 合成, 打廣東話都得,仲可以沿用上一張圖繼續微調。

🆓 Flux 模型即玩,不用登入
🤖 登入後解鎖 Gemini 改圖
📷 支援上載參考圖再生成
⚡ 每天免費額度任你玩
✨ 即刻玩 AI 畫圖
{
  "image_generation_request": {
    "prompt": "Ultra-realistic portrait of a man walking toward the camera on an airport runway at night He wears a white long-sleeve shirt with sleeves rolled up and dress pants, shoes. The camera is very close, capturing his face sharply - textures of skin, smoke from his lips, and subtle reflections of firelight in his eyes. Behind him, slightly out of focus, a commercial airplane is burning intensely, with huge flames, roaring firestorms, and thick black smoke rising high. The fiery glow casts dramatic orange highlights on his shirt and face, creating deep shadows and a gritty, cinematic mood. Wet runway reflects the blaze, enhancing the dramatic atmosphere.",
    "dimensions": {
      "width": 1200,
      "height": 1200
    },
    "style_descriptors": [
      "Cinematic",
      "Photorealistic",
      "Gritty",
      "Dramatic Lighting",
      "Macro Photography",
      "8k resolution"
    ],
    "subject_details": {
      "action": "Walking toward camera, smoking",
      "clothing": "White long-sleeve shirt (rolled sleeves), dress pants, shoes",
      "facial_features": "Sharp focus, skin texture, firelight reflection in eyes"
    },
    "environment_details": {
      "location": "Airport runway at night",
      "background": "Commercial airplane burning, intense fire, thick black smoke, out of focus",
      "ground": "Wet runway, reflecting fire"
    }
  }
} Prompt:
Use my image in Ultra-realistic, hyper-detailed, 8K cinematic portrait of a young stylish man, using the uploaded image for exact face and hairstyle.
Outfit: An oversized red knit sweater with white hearts, exactly as described in the prompt.
Pose: A hyper-realistic close-up portrait with a messy, cropped framing showing only the boy holding the book. His left hand rests on the wooden table and covers part of his cheek, with a subtle smile on his lips. His other hand holds the book titled "Something I Never Told You" with the word "YOU" written in pink, exactly as
described in the prompt. Background: Not specified. Create an image that captures a person working on a laptop while sitting on a wooden beach chair on a sandy beach.
Here are some key details:
Subject: A man uploaded photo wearing a light-colored, long-sleeved shirt open botten (possibly linen or a light denim), dark shorts. He is focused intently on the screen and keyboard of his silver laptop.
Setting: The scene is set on a beach during sunset or sunrise, indicated by the warm, golden light and the long shadows. There is a palm tree towering over the person, and its fronds are visible against the bright sky. The ocean is in the background.
Atmosphere: The overall mood is one of a "digital nomad" or someone enjoying the flexibility of working remotely in a beautiful, relaxed, and warm location. The lighting creates a very aesthetic and aspirational feel.
Foreground Detail: To the left of the chair, there's a wooden crate or small table where a portion of a coconut appears to be resting.
The photo effectively contrasts the intensity of work with the serene,