Deepseek学习


Deepseek学习


理论

从函数到神经网络 https://www.bilibili.com/video/BV1uGA3eLEeu/

本地安装

参阅 https://mp.weixin.qq.com/s/tldvEPM3LEd84sJIy-MrzA

在 https://ollama.com 下载 ollama大型语言模型(LLM) 盒子并安装。

cmd打开命令行,下载1.5b的 deepseek-r1:

ollama run deepseek-r1:1.5b

安装完成后就可以对话使用了。

下次重新使用:

ollama run deepseek-r1:1.5b

查看电脑上装了多少个模型:

ollama list

删除模型:

ollama rm deepseek-r1:1.5b

查看ollama其他信息:

ollama

如停止模型运行:

ollama stop

Open-WebUI

为了更好的页面体验,接下来可以选择安装 Open-WebUI。

在 https://www.docker.com/ 下载 docker桌面版 并安装,重启电脑。

在 https://docs.openwebui.com/ 查看Open-WebUI 的安装命令,在cmd命令行中执行:

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

打开docker运行Open-WebUI,注册后对话。

Page Assist浏览器插件

参阅 https://mp.weixin.qq.com/s/d9sXWD063G-ZiI7AXP98Cg,里面也提到了 代码调用。

为了更好的页面体验,选择 Page Assist 浏览器插件。打开chrome应用商店,搜索“Page Assist”,点击安装。安装完成后点击插件进行使用。

ChatBox

参阅 https://mp.weixin.qq.com/s/wKKAAKZinfXlFYVX9e_W8A,具体配置部分不一样。https://pan.quark.cn/s/4e3a3843a943#/list/share 网盘中提供的资料有好多可以读一下。

为了更好的页面体验,也可以选择安装 ChatBox。Chatboxai 是一款专业的聊天机器人应用。

在 https://chatboxai.app/zh 下载 ChatBox 并安装。

打开ChatBox,点击设置,模型提供方 选择 “Ollama API”,API域名刷新,保存后就可以正常对话了。

联网搜索

联网搜索、图像生成可以参阅 https://mp.weixin.qq.com/s/WjWqPNlT_Ny-LFhqOs7Crg,也是结合Ollama与Open-WebUI配置的,图像生成使用到了ComfyUI。

本地知识库

CherryStudio

https://post.smzdm.com/p/am3rnxwz/

DeepSeek+本地知识库搭建 https://mp.weixin.qq.com/s/IKoBga2iKfpkdD4Qgy8iLg

电脑配置本地部署私人知识库 https://mp.weixin.qq.com/s/Mx_o7sM8_m1gTS6A6GZpnA

用DeepSeek搭建个人知识库 https://mp.weixin.qq.com/s/5pHIfyGqvfvtEekjWE0F1A

3分钟教你免费快速安全地部署本地DeepSeek https://mp.weixin.qq.com/s/vZhxlZQCSWfw9eeT-UYq6Q

内外网DeepSeek部署实战:Ollama + 多客户端 + RAG + 越狱 https://mp.weixin.qq.com/s/ll6Mc5F6YJOGbotcdP2Y1w

AnythingLLM

用DeepSeek和AnythingLLM搭建个人知识库 https://mp.weixin.qq.com/s/cOV2Ho3ud7d3v7j9eEjVjQ

https://github.com/Mintplex-Labs/anything-llm

https://anythingllm.com/

Deepseek在windows上本地部署、投喂素材、编程交互 https://mp.weixin.qq.com/s/Z1Q5HxEAOiGJyoeuhFlfAQ

deepseek本地部署最简教程——搭建个人AI知识库 https://mp.weixin.qq.com/s/f5acKDixrYb36Wa6RWQ8Dg

DeepSeek+本地知识库 https://mp.weixin.qq.com/s/sWrwaMSozegrRs8iiIU8sA

RAGFlow

deepseek+RAGFlow本地部署+搭建知识库 https://mp.weixin.qq.com/s/Of2Qkn8vShHDnYUJtIattQ

DeepSeek+RAGFlow 本地部署避坑指南 https://mp.weixin.qq.com/s/x1q9CEEHDABed5k7Ws4fGg

用Ollama+RAGflow打造私有知识库 https://mp.weixin.qq.com/s/MHpf9PRc3Kr55iSakC3oVg

图片

用 Deepseek 一句话生成动态海报 https://mp.weixin.qq.com/s/amNqvdhsm86HiLCasLgC0g

视频

Deepseek做AI爆款视频 https://mp.weixin.qq.com/s/BcHbyuGMLBWIlSjrp_hbYA

DeepSeek生成微课视频 https://mp.weixin.qq.com/s/4f_CVjVl3ZUrt3uQQuhggA

工具清单(全免费+国内可用)
脚本生成:DeepSeek(深度求索)、文心一言
PPT制作:MindShow、Gamma、Canva AI(免费模板)
配音生成:微软Azure语音(免费额度)、剪映AI配音
视频剪辑:剪映专业版、必剪
素材资源:Pixabay、Unsplash(免费版权图片/视频)

Word

参阅 https://mp.weixin.qq.com/s/YCVSBmsW960mRcFPu7oN6A

如何在Word上接入DeepSeek https://www.songshuhezi.com/deepseek/integration_word.html

豆包

下面附一下豆包的宏代码:

' 创建正则表达式的辅助函数
Private Function CreateRegex(Pattern As String) As Object
    Set CreateRegex = CreateObject("VBScript.RegExp")
    With CreateRegex
        .Global = True
        .MultiLine = True
        .IgnoreCase = False
        .Pattern = Pattern
    End With
End Function

' 内容格式处理函数
Private Function ParseContent(rawText As String) As String
    ' 按顺序处理转义字符(关键顺序!)
    ParseContent = rawText
    ParseContent = Replace(ParseContent, "\\", ChrW(92))        ' 先处理反斜杠转义
    ParseContent = Replace(ParseContent, "\""", Chr(34))        ' 处理转义双引号
    ParseContent = Replace(ParseContent, "\n", vbNewLine)       ' 处理换行符
    ParseContent = Replace(ParseContent, "\t", vbTab)           ' 处理制表符
End Function

' 增强版 Unicode 解码函数(可选)
Private Function DecodeUnicode(str As String) As String
    Dim regex As Object
    Set regex = CreateRegex("\\u([0-9a-fA-F]{4})")
    
    DecodeUnicode = regex.Replace(str, "$1")
    DecodeUnicode = StrConv(DecodeUnicode, vbUnicode)
End Function

Function CallDeepSeekAPI(api_key As String, inputText As String) As String
    Dim API As String
    Dim SendTxt As String
    Dim Http As Object
    Dim status_code As Integer
    Dim response As String

    API = "https://ark.cn-beijing.volces.com/api/v3/chat/completions"
    SendTxt = "{""model"": ""deepseek-r1-250120"", ""messages"": [{""role"":""system"", ""content"":""You are a Word assistant""}, {""role"":""user"", ""content"":""" & inputText & """}], ""stream"": false}"

    Set Http = CreateObject("MSXML2.XMLHTTP")
    With Http
        .Open "POST", API, False
        .setRequestHeader "Content-Type", "application/json"
        .setRequestHeader "Authorization", "Bearer " & api_key
        .send SendTxt
        status_code = .Status
        response = .responseText
    End With

    ' 弹出窗口显示 API 响应(调试用)

    ' MsgBox "API Response: " & response, vbInformation, "Debug Info"

    If status_code = 200 Then
        CallDeepSeekAPI = response
    Else
        CallDeepSeekAPI = "Error: " & status_code & " - " & response
    End If

    Set Http = Nothing
End Function

Sub DoubaoDeepSeekR1()
    Dim api_key As String
    Dim inputText As String
    Dim response As String
    Dim regex As Object
    Dim reasoningRegex As Object
    Dim contentRegex As Object
    Dim matches As Object
    Dim reasoningMatches As Object
    Dim originalSelection As Object
    Dim reasoningContent As String
    Dim finalContent As String

    api_key = "替换为你的api key"
    If api_key = "" Then
        MsgBox "Please enter the API key."
        Exit Sub
    ElseIf Selection.Type <> wdSelectionNormal Then
        MsgBox "Please select text."
        Exit Sub
    End If

    ' 保存原始选中的文本
    Set originalSelection = Selection.Range.Duplicate

    inputText = Replace(Replace(Replace(Replace(Replace(Selection.text, "\", "\\"), vbCrLf, ""), vbCr, ""), vbLf, ""), Chr(34), "\""")
    response = CallDeepSeekAPI(api_key, inputText)

    If Left(response, 5) <> "Error" Then
        ' 创建正则表达式对象来分别匹配推理内容和最终回答
        Set reasoningRegex = CreateRegex("""reasoning_content""\s*:\s*""((?:[^""\\]|\\.)*)""")
        Set contentRegex = CreateRegex("""content""\s*:\s*""((?:[^""\\]|\\.)*)""")

        ' 提取推理内容
        Set reasoningMatches = reasoningRegex.Execute(response)
        If reasoningMatches.Count > 0 Then
            reasoningContent = reasoningMatches(0).SubMatches(0)
            reasoningContent = Replace(reasoningContent, "\n\n", vbNewLine)
            reasoningContent = Replace(reasoningContent, "\n", vbNewLine)
            reasoningContent = Replace(Replace(reasoningContent, """", Chr(34)), """", Chr(34))
        End If

        ' 提取最终回答
        Set matches = contentRegex.Execute(response)
        If matches.Count > 0 Then
            finalContent = matches(0).SubMatches(0)
            finalContent = Replace(finalContent, "\n\n", vbNewLine)
            finalContent = Replace(finalContent, "\n", vbNewLine)
            finalContent = Replace(Replace(finalContent, """", Chr(34)), """", Chr(34))

            ' 取消选中原始文本
            Selection.Collapse Direction:=wdCollapseEnd

            ' 插入推理过程(如果存在)
            If Len(reasoningContent) > 0 Then
                Selection.TypeParagraph
                Selection.TypeText "推理过程:"
                Selection.TypeParagraph
                Selection.TypeText reasoningContent
                Selection.TypeParagraph
                Selection.TypeText "最终回答:"
                Selection.TypeParagraph
            End If

            ' 插入最终回答
            Selection.TypeText finalContent

            ' 将光标移回原来选中文本的末尾
            originalSelection.Select
        Else
            MsgBox "Failed to parse API response.", vbExclamation
        End If
    Else
        MsgBox response, vbCritical
    End If
End Sub

上面的代码 " 没有转义成功,如会输出 "你好"

接入文档:https://www.volcengine.com/docs/82379/1298454

Excel

https://www.songshuhezi.com/deepseek/integration_excel.html

https://mp.weixin.qq.com/s/IQIszkXc0PeVJ8S85u2Jzw

https://mp.weixin.qq.com/s/FRJtA7xGwQrR-DjTPGbPeA

https://mp.weixin.qq.com/s/9gT_7cvq54OVFrylfBxv4w

https://mp.weixin.qq.com/s/G8XKlCoZZGLGcsipiswsOQ

https://mp.weixin.qq.com/s/oqnO4-1JdsZQQSFwjGo_SA

DeepSeek+Excel一键解决办公问题 https://mp.weixin.qq.com/s/lgEUqa8s2B7QF_eQEQ6dYA

https://mp.weixin.qq.com/s/PSThcgsNW-ttB9Of8tTmAA

豆包

下面附一下豆包的宏代码(存在问题未解决,功能只是问答,实际意义不大):

'VBA代码应用
'▲▲▲ API配置区 ,修改API-key!其他不变
Const AI_URL As String = "https://ark.cn-beijing.volces.com/api/v3/chat/completions"
'填写你的API key
Const AI_KEY As String = "替换为你的api key"

Const AI_MODEL As String = "deepseek-r1-250120"

'AI交互函数不变
Private Function GetAIResponse(prompt As String) As String
    Dim oXmlHttp As Object, requestBody As String
    Dim startTime As Double, apiResponse As String

    Const TIMEOUT_MSG As String = "请求超时,可能原因:" & vbCrLf & _
                                "1. 网络连接问题" & vbCrLf & _
                                "2. API服务繁忙" & vbCrLf & _
                                "是否重试?"
    Const PROCESSING_MSG As String = "AI分析中,已耗时 "

    On Error GoTo ErrorHandler
    Set oXmlHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")

    '▲▲▲ 超时参数配置 ▲▲▲
    oXmlHttp.setTimeouts 5000, 8000, 20000, 60000

    '▼▼▼ 构建专业请求 ▼▼▼
    With oXmlHttp
        .Open "POST", AI_URL, False
        .setRequestHeader "Content-Type", "application/json;"
        .setRequestHeader "Authorization", "Bearer " & AI_KEY
        .setRequestHeader "Accept", "*/*"
    End With

    requestBody = "{""model"":""" & AI_MODEL & """," & _
            """messages"":[{""role"":""user"",""content"":""" & JSONEscape(prompt) & """}]," & _
            """temperature"":0.7,""max_tokens"":512}"

    '▲▲▲ 异步处理控制 ▲▲▲
    startTime = Timer
    oXmlHttp.send requestBody

    Do While oXmlHttp.readyState <> 4
        If Timer - startTime > 60 Then
            If MsgBox(TIMEOUT_MSG & "耗时:" & Format(Timer - startTime, "0.0") & "秒", _
                      vbCritical + vbRetryCancel) = vbRetry Then
                oXmlHttp.abort
                startTime = Timer
                oXmlHttp.send requestBody
            Else
                Exit Function
            End If
        End If
        DoEvents
        Application.StatusBar = PROCESSING_MSG & Format(Timer - startTime, "0.0") & "秒"
    Loop

    '▼▼▼ 响应处理 ▼▼▼
    If oXmlHttp.Status = 200 Then
        apiResponse = oXmlHttp.responseText
        GetAIResponse = ExtractJSONContent(apiResponse)
    Else
        Err.Raise vbObjectError + 1, , "API错误:" & oXmlHttp.Status & " - " & oXmlHttp.statusText
    End If

Exit Function

    ErrorHandler:
        If Err.Number = -2147012894 Then
            If MsgBox(TIMEOUT_MSG, vbExclamation + vbRetryCancel) = vbRetry Then Resume
        Else
            MsgBox "AI交互错误:" & Err.Description, vbCritical
        End If
        GetAIResponse = "错误:" & Err.Description
        Finally:
        Application.StatusBar = False
        Set oXmlHttp = Nothing

End Function


'辅助函数:JSON转义
Private Function JSONEscape(str As String) As String
    JSONEscape = Replace(Replace(Replace(str, "\", "\\"), """", "\"""), vbCrLf, "\n")
End Function


'辅助函数:提取JSON内容
Private Function ExtractJSONContent(responseText As String) As String
    Dim contentStart As Long, contentEnd As Long
    contentStart = InStr(responseText, """content"":""") + 11
    contentEnd = InStr(contentStart, responseText, """")
    ExtractJSONContent = Replace(Mid(responseText, contentStart, contentEnd - contentStart), "\n", vbCrLf)
End Function


'主任务:数据处理流程
Sub DoubaoDeepSeekR1()
    Dim prompt As String, aiResponse As String
    Dim ws As Worksheet

    On Error GoTo ErrorHandler
    Set ws = ActiveSheet

    '▲▲▲ 构建专业提示词 ▲▲▲ 提问写在A2
    prompt = Range("A2")

    '▼▼▼ AI交互 ▼▼▼
    aiResponse = GetAIResponse(prompt)

    '▲▲▲ 结果输出 在A4
    ws.Range("A4").Value = aiResponse
    ws.Range("A4").WrapText = True

Exit Sub

    ErrorHandler:
        MsgBox "处理数据时发生错误:" & Err.Description, vbCritical
End Sub

结合PPT

DeepSeek做PPT https://mp.weixin.qq.com/s/SMX13k6NwXP_soNIeOaw5A

观看 https://v.douyin.com/ncaT8x0bsfk/

airPPT 或者 开美PPT助手。

PPT制作:MindShow、Gamma、Canva AI(免费模板)

https://www.songshuhezi.com/deepseek/integration_ppt.html

结合WPS

参阅 https://mp.weixin.qq.com/s/th41eil4-RbRzjUBi69spQ

https://mp.weixin.qq.com/s/KsZx9cB61fJy6CeJGayDtw

使用技巧

参阅 https://mp.weixin.qq.com/s/UfBOuJwLX3D3cqDOulT8qA

https://mp.weixin.qq.com/s/TRyRUIFTQYHtstMSpyBtxA

20个很强的DeepSeek提问公式 https://mp.weixin.qq.com/s/qrkn0XY7yDGttLKOeY83-w

https://mp.weixin.qq.com/s/6YfBaNrFhB28fuHeScqehg

清华出的DeepSeek使用手册 https://mp.weixin.qq.com/s/ckxVWOXCFWBk9ivXYmrwDA

DeepSeek 使用指南:30 条指令,秒变 AI 高手 https://mp.weixin.qq.com/s/dgK4y21L7sFCOORlTXzTBA

硅基流动(SiliconFlow)

https://mp.weixin.qq.com/s/9xvukEJGmtCaSTX-oLBOMQ

编码

VSCode

https://www.zhihu.com/question/311803609/answer/102091019403

MarsCode

豆包的编码助手

DeepSeek 装进 VSCode https://mp.weixin.qq.com/s/ImEgK0r5PJfCfLrTC-i-jA

Roo Code

参阅 https://www.songshuhezi.com/deepseek/integration_vscode_roo_code.html

Continue

参阅 https://mp.weixin.qq.com/s/jeU51J7nR7hESDOxpmZa6Q

VsCode变身免费AI助手,利用本地部署的Deepseek辅助编程 https://mp.weixin.qq.com/s/VKwRcjGmT47plswHe8KpUQ

Cline

观看 https://v.douyin.com/rPxX_1ZchOQ/

https://mp.weixin.qq.com/s/LmA_VdsgEJavro6N7z5O8w

插件安装后,可以使用阿里的千问。

实际使用

通过deepseek+draw.io一键搞定各种可视化图片 https://www.songshuhezi.com/deepseek/case_draw_io.html

通过deepseek+KIMI高效生成PPT https://www.songshuhezi.com/deepseek/case_kimi_ppt.html

通过deepseek+Photoshop一句话修复老照片 https://www.songshuhezi.com/deepseek/case_old_photographs.html

5 个 Deepseek 王炸组合 https://mp.weixin.qq.com/s/eMAtq1CXyl5jbY_HmBanBg

deepseek 做 AI 视频全流程 https://mp.weixin.qq.com/s/BDkTYqu4s-yytb89FruRSA

DeepSeek出图 https://mp.weixin.qq.com/s/XabC53iGdMoTq6mfpJe9Cg






参考资料

DeepSeek 使用技巧 https://mp.weixin.qq.com/s/UfBOuJwLX3D3cqDOulT8qA

把DeepSeek部署在你的电脑上 https://mp.weixin.qq.com/s/tldvEPM3LEd84sJIy-MrzA

DeepSeek本地部署 https://mp.weixin.qq.com/s/wKKAAKZinfXlFYVX9e_W8A

DeepSeek-R1个人和企业本地快速部署手册 https://mp.weixin.qq.com/s/T01TfZsUQnu0S7_2Vc_gWQ

四个方法,免费快速,彻底解决 deepseek 服务器繁忙问题 https://mp.weixin.qq.com/s/NRHUrIvSpkCtFdDF6XFmMQ

如何用Deepseek3秒备课 https://mp.weixin.qq.com/s/8pD6ZNIzgZdv9NhnnG2XIQ

DeepSeek如何改变课堂?教师必备的20个AI教学场景 https://mp.weixin.qq.com/s/dhHVPZI2mN9pLsLxhy58Pw


返回