《DeepSeek入门宝典》第2册.开发实战篇 (51CTO)(Z-Library)
AI
No Description
234
Views
0
Downloads
0.00
Total Donations
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Page
1
DeepSeek入门宝典
Page
2
DeepSeek入门宝典 DeepSeek 赋能开发者 • DeepSeek 的核心价值及三大优势 • 部署DeepSeek的五大决策关键
Page
3
DeepSeek入门宝典 DeepSeek的核心价值 企业端:降本增效 代表企业:恒瑞医药、极氪 产品端:体验升级 代表产品:华为小艺、飞书 开发者:辅助开发 用法:代码生成、代码改写 图片来源:社交媒体 图片来源:HarmonyOS技术领航者 图片来源:DeepSeek官网
Page
4
DeepSeek入门宝典 D e e p S e e k 的 三 大 优 势 高性能 性能可对标OpenAI o1 低成本 R1比o1的API价格低20多倍 开发者友好 能兼容OpenAI的API格式 图注:DeepSeek官方API定价
Page
5
DeepSeek入门宝典 部署DeepSeek的五大决策关键 数据敏感性评估 数据敏感 本地、私有云 响应延迟要求 需要超低延迟 边缘计算 使用频次 长期高频 本地、云托管 算力、技术资源 无运维团队 API、云托管 合规性要求 高合规要求 本地部署+安全审计
Page
6
DeepSeek入门宝典 开 发 者 部 署 DeepSeek Ø 官方API使用 Ø 私有化本地部署 Ø 云平台托管部署 • 开发者部署DeepSeek的三种主流方式 • 部署DeepSeek的其他方式
Page
7
DeepSeek入门宝典 开发者部署DeepSeek的三种主流方式 以下为部署DeepSeek的三种主流方式,下文将提供入门教程: 官方API 本地化私有部署 云平台托管部署 优:零运维成本、按需付费 缺:网络延迟 优:数据安全,高度定制化 缺:需GPU资源、人工运维 优:弹性扩缩容、混合云支持 缺:云服务商依赖、跨云管理
Page
8
DeepSeek入门宝典 官方 API 使用:首次调用 使用 DeepSeek API 之前,请先 创建 API 密钥 https://api-docs.deepseek.com/zh-cn/api/deepseek-api 在创建 API key 之后,你可以使用以下样例的python脚本访问 DeepSeek API 图片来源:DeepSeek官网
Page
9
DeepSeek入门宝典 官方 API使用:关键参数 图片来源:DeepSeek官网 调用 DeepSeek-V3 调用 Deepseek-R1 默认最大输出长度为 4K,可手动调整至8K 参数默认为 1.0,建议 根据使用场景进行配置
Page
10
DeepSeek入门宝典 官方 API使用:常见错误与解决 400 - 格式错误 根据错误信息提示 修改请求体 401 - 认证失败 检查API key 是否 正确 402 - 余额不足 确认余额,及时充 值 422 - 参数错误 请根据错误信息提 示修改相关参数 429 - 请求速率达 到上限 合理规划请求 速率 500 - 服务器故障 稍后重试,联 系官方 503 - 服务器繁忙 稍后重试
Page
11
DeepSeek入门宝典 私有化本地部署(1) 本地部署DeepSeek-R1蒸馏版,可通过Ollama、vLLM等工具,简化部署过程 以下教程以Ollama为示例, Ollama下载链接:https://ollama.com/download 本页图片来源: Ollama官网 1.下载Ollama 2.打开模型列表,下载DeepSeek R1 进入https://ollama.com/library/deepseek-r1 选择合适参数量的模型
Page
12
DeepSeek入门宝典 3.安装下载的模型 4.输入运行指令,与R1进行对话 打开本地的命令提示符,输入下列指令 (以7b 模型为例) 通过ollama list指令查看所有本地模型 占用的存储空间 以下是对话以模型的输出: 本节内容有参考: 1.https://mp.weixin.qq.com/s/iKfE67M42ROWVCMTe6wbFA 2.https://mp.weixin.qq.com/s/GQ7tjmJsLr2Idd0raD-wKg 私有化本地部署(2)
Page
13
DeepSeek入门宝典 云平台托管部署(1) 目前国内主流云平台均已支持DeepSeek模型,如硅基流动×华为云、腾讯云、百度智能云等。 以下教程以硅基流动为示例, 地址:https://cloud.siliconflow.cn/i/adxzw8w3af 本页图片来源:硅基流动官网 1.注册并登录云平台 2.新建API密钥 左侧导航栏→API密钥→新建
Page
14
DeepSeek入门宝典 本页图片来源: Chatbox AI 3.下载AI开发工具 4.安装开发工具,选择模型提供方 下载Cherry Studio或Chatbox AI开发工具 教程以Chatbox AI为例,地址: https://chatboxai.app/ 选择自己使用的API,下图红框中为硅基流动 云平台托管部署(2)
Page
15
DeepSeek入门宝典 本页图片来源: Chatbox AI 5.填写API密钥,选择模型 6.与R1进行对话 云平台托管部署(3)
Page
16
DeepSeek入门宝典 部署DeepSeek的其他方式 以下为部署DeepSeek的三种进阶方式,此处进行简单介绍,本册不再展开: 边缘计算部署 容器化微服务部署 混合架构部署 在靠近数据源的边缘节点部署轻量化模型 通过Docker/Kubernetes构建模型微服务集群 组合多种部署方式 优 : 超低延迟、断网可用 缺 : 模型需蒸馏、边缘硬 件适配 优 : 资源隔离、灰度发布 缺 : 需要K 8s运维能力 优 : 兼顾安全与成本、灵活 缺 : 架构设计复杂度高
Page
17
DeepSeek入门宝典 DeepSeek 辅助开发 Ø 代码改写 Ø 代码解释 Ø 代码生成 Ø 实用集成工具 • 辅助开发基本功能
Page
18
DeepSeek入门宝典 对代码进行修改,实现纠错、注释、调优等。 辅助开发实例1:代码改写 提示词 样例输出 下面这段的代码的效率很低,且没有 处理边界情况。请先解释这段代码的 问题与解决方法,然后进行优化: 本页起图片均来源自 DeepSeek官网,不再标注。
Page
19
DeepSeek入门宝典 对代码进行解释,理解代码内容。 辅助开发实例2:代码解释 请解释下面这段代码的逻辑,并说明完成了什么 功能: 提示词 样例输出
Page
20
DeepSeek入门宝典 让模型生成一段完成特定功能的代码。 辅助开发实例3:代码生成(1) 请用xx编程语言生成一个实现xx目的 的代码: 例:请帮我用 HTML 生成一个五子棋 游戏,所有代码都保存在一个 HTML 中。 提示词 样例输出
The above is a preview of the first 20 pages. Register to read the complete e-book.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
【One-Line Pitch】
A hands-on developer’s manual for deploying and using DeepSeek models in real projects, covering API integration, local and cloud deployment, and AI-assisted coding workflows. Ideal for developers and tech leads who want a practical, decision-oriented entry point without wading through theoretical AI content.
【Book Arc】
- **Opening (~0%–10%)**: Establishes DeepSeek’s core value proposition—cost reduction for enterprises, product experience upgrades, and developer productivity gains—alongside its three competitive advantages: high performance (comparable to OpenAI o1), significantly lower API pricing, and OpenAI-compatible API format. This section frames why a developer should consider DeepSeek over alternatives.
- **Early (~10%–30%)**: Walks through the five key deployment decision factors—usage frequency, latency requirements, compute resources, data sensitivity, and compliance needs—mapping each to a recommended deployment mode (API, local, cloud, edge). This is a practical decision framework rather than abstract theory.
- **Middle (~30%–60%)**: Provides step-by-step tutorials for the three mainstream deployment methods: official API usage (including key creation, parameter tuning, and common error codes like 400, 401, 429), local private deployment via Ollama (downloading models, running commands, verifying with `ollama list`), and cloud-hosted deployment using platforms like SiliconFlow (API key setup, tool installation, and model selection).
- **Late (~60%–85%)**: Introduces advanced deployment options—edge computing, containerized microservices (Docker/Kubernetes), and hybrid architectures—with brief trade-off summaries. It then shifts to AI-assisted development, covering four core functions: code rewriting, code explanation, code generation, and integration with existing frameworks (AI Agent, RAG, Solana).
- **Ending (~85%–100%)**: Concludes with practical examples of code generation (e.g., building a Gomoku game in HTML), a list of applications that have already integrated DeepSeek, and pointers to official resources, 51CTO’s AI portal, and a large catalog of video courses for continued learning.
【Key Takeaways】
- **DeepSeek’s core value is threefold** (Early): enterprises get cost reduction and efficiency gains, products achieve better user experiences, and developers receive concrete coding assistance—code generation, rewriting, and explanation. This framing helps readers quickly identify which use case applies to them.
- **Five decision factors determine deployment strategy** (Early): usage frequency, latency needs, compute/ops resources, data sensitivity, and compliance requirements. For example, high-frequency usage and low-latency demands push toward local or edge deployment, while teams without ops capacity should default to API or cloud hosting.
- **Official API is the fastest path to production** (Middle): with zero maintenance overhead and pay-as-you-go pricing, it suits most teams. Key operational details include creating an API key, adjusting the default 4K max output length to 8K, and understanding common error codes—401 for auth failures, 429 for rate limits, 503 for server busy—to troubleshoot efficiently.
- **Local deployment is viable via Ollama** (Middle): downloading the DeepSeek-R1 distilled model through Ollama simplifies the process significantly. After installation, running a command like `ollama run deepseek-r1:7b` enables local dialogue, and `ollama list` verifies installed models and storage usage—a good fit for data-sensitive environments.
- **Cloud platforms offer a middle ground** (Middle): services like SiliconFlow, Tencent Cloud, and Baidu AI Cloud host DeepSeek models, reducing infrastructure burden. The tutorial demonstrates using Chatbox AI or Cherry Studio as client tools, connecting via API key to start chatting within minutes.
- **Advanced deployment adds flexibility** (Late): edge computing provides ultra-low latency and offline capability (though models need distillation), containerized microservices enable resource isolation and gray releases (requiring Kubernetes skills), and hybrid architectures balance security and cost—but increase design complexity.
- **AI-assisted coding is practical today** (Late): four core functions—code rewriting (fixing inefficiencies and edge cases), code explanation (understanding unfamiliar logic), code generation (e.g., a complete HTML Gomoku game), and framework integration (AI Agent, RAG, Solana)—demonstrate immediate productivity gains with well-crafted prompts.
【Reading Tips】
- **Skim the opening value proposition** (~0%–10%) if you already know why you want to use DeepSeek; it’s mostly positioning content. Focus instead on the deployment decision table, which is the book’s most reusable framework.
- **Deep-read the three deployment tutorials** (~30%–60%) if you plan to implement any of them. The API section’s error-code table is worth memorizing or bookmarking for production debugging. The Ollama and SiliconFlow walkthroughs are step-by-step and can be followed directly.
- **Treat the advanced deployment section** (~60%–85%) as a survey, not a deep dive. The book explicitly states it won’t expand on edge, containerized, or hybrid approaches—use it to scope future research rather than as an implementation guide.
- **Practice the coding examples** (~85%–100%) rather than just reading them. The Gomoku HTML generation example is a quick, satisfying test of DeepSeek’s code generation capability; try modifying the prompt to see how output quality changes.
- **Watch for the integration appendix**: the list of applications and frameworks that already support DeepSeek is a practical shortcut—checking it first might save you from building integrations that already exist.
【Coverage Limits】
The excerpts cover deployment decision-making, three mainstream deployment methods, and AI-assisted coding functions, but do not include advanced topics like fine-tuning, prompt engineering best practices, or performance benchmarking against other models. The advanced deployment section (edge, containerized, hybrid) is mentioned but not detailed.
Passage locations
Excerpt 1
书名: 《DeepSeek入门宝典》第2册.开发实战篇 (51CTO)(Z-Library) 作者: 51CTO DeepSeek入门宝典 DeepSeek入门宝典 DeepSeek • DeepSeek 的核心价值及三大优势 赋能开发者 • 部署DeepSeek的五大决策关键 DeepSeek入门宝典 Deep...
View in text
Excerpt 2
API密钥→新建 本页图片来源:硅基流动官网 DeepSeek入门宝典 云平台托管部署(2) 3.下载AI开发工具 4.安装开发工具,选择模型提供方 下载Cherry Studio或Chatbox AI开发工具 选择自己使用的API,下图红框中为硅基流动 教程以Chatbox AI为例,地址: https://c...
View in text
Recommended for You
{{#thumbnailUrl}}
{{/thumbnailUrl}}
{{^thumbnailUrl}}
{{/thumbnailUrl}}
Loading recommended books...
Failed to load, please try again later
Tip the Site
Scan the WeChat Pay or Alipay code to tip. No login required.
WeChat Pay
Alipay