安裝 Ollama 並執行 DeepSeek 模型指南 (Windows)
Ollama 是一個開源工具,讓您可以在本地端輕鬆下載、安裝並執行各種大型語言模型 (LLM),包括 DeepSeek 系列模型。本指南將引導您完成在 Windows 系統上的安裝與設定過程。
步驟一:下載並安裝 Ollama
- 前往 Ollama 官方網站: Open your web browser and go to https://ollama.com/。
-
Download the Windows version:
The download button is usually visible directly on the home page. Click the "Download for Windows" button to download Ollama's installer (
OllamaSetup.exe)。
-
執行安裝程式:
Once the download is complete, locate
OllamaSetup.exeSave the file and run it. -
Follow the installation wizard instructions:
Usually, just clicking Install or Next and agreeing to the license terms completes the installation. The installer sets up Ollama as a background service and adds its command-line tools to the system path.
- Installation completed: 安裝成功後,Ollama 會在系統匣 (System Tray) 中顯示一個圖示,表示其服務正在背景執行。
步驟二:驗證 Ollama 安裝
-
開啟命令提示字元或 PowerShell:
You can click
Win+Rkeys, entercmd或powershell, then press Enter. -
Run the Ollama command:
在命令提示字元或 PowerShell 視窗中,輸入以下指令並按下 Enter:
ollama --version -
Confirm output:
If the installation was successful, you should see the Ollama version number, e.g.
ollama version is 0.1.xxThis means that Ollama has been successfully installed and can be used from the command line.
步驟三:下載並執行 DeepSeek 模型
Ollama Download and run models with simple commands. DeepSeek has a variety of models, commonly used are general conversational models (such as deepseek-llm) and code-specific models (such as deepseek-coder). You need to choose according to your needs.
-
Select the DeepSeek model:
You can access Ollama's official model repository athttps://ollama.com/library) Search for "deepseek" to see available models and their tags. Common models include:
deepseek-llm: A general conversation model with multiple sizes (e.g., 7b, 67b).deepseek-coder: Models optimized for code generation and understanding, and in multiple sizes
Consider model size The number after the model name (e.g. 7b, 67b) represents the number of parameters in the model (b = billion). Larger models are generally more capable, but require more memory (RAM) and more powerful hardware. It is recommended to start with smaller models (e.g. 7b). -
下載並執行模型 (以 deepseek-coder:7b 為例):
In a command prompt or PowerShell, run the following command. This command will automatically download the model (if it has not already been downloaded) and then launch an interactive dialog interface:
ollama run deepseek-coder:7b(If you want to use a generic conversation model, you can run
ollama run deepseek-llm:7b) -
Wait for download to complete:
When you first run Ollama, it will start downloading the model files, which may take some time depending on your network speed and the size of the model. You will see the download progress.
-
Start interacting:
After the download is complete, you will see a prompt (usually a
>>>or similar symbols) indicates that you can start typing to interact with the DeepSeek model.直接輸入您的問題或指令,然後按下 Enter。模型會生成回應。>>> Send a message (/? for help) -
Ending the interaction:
To exit interactive mode, enter
/byeOr pressCtrl+D。
Commonly used Ollama commands
ollama listList the models you have downloaded locally.ollama pull [model_name]:[tag]:僅下載模型,但不立即執行。例如:ollama pull deepseek-llm:latestollama rm [model_name]:[tag]: Delete locally downloaded models to free up space.ollama help:Show help information.
Conclusion
Following these steps, you should have successfully installed Ollama on your Windows computer and be able to download and run the DeepSeek model. Now you can start exploring and utilizing these powerful AI models locally! Remember to choose the right model size based on your hardware capabilities.
