Tutorial configures DeepSeek Flash through an OpenAI-compatible API
A Juejin AI tutorial shows how to call DeepSeek Flash through the OpenAI SDK’s chat completions interface, using a custom base URL and API key. Its sample combines a system prompt, temperature and top_p settings, a 20-token limit, a stop sequence, and streaming output to generate a short Chinese milk-tea slogan. The article also says Flash defaults to reasoning mode, while the Chat variant provides direct output without reasoning.
The example gives developers a concrete starting point for configuring DeepSeek Flash, but its model-mode and billing explanations come from a single community tutorial.
DeepSeek中的自学应用参数配置理解:
model="deepseek-flash",
选哪个模型。 这里用的是 DeepSeek 的 Flash 版,特点是快、便宜,适合日常对话、简单任务。它默认是思考模式,模型会先"想"再答,思考过程也会占 token 计费。如果你不需要思考、只想快速出结果,可以通过切换 Chat 模型不会思考,直接输出,自学自研更省钱。
messages=[
{"role": "system", "content": "写一句关于夏天奶茶的宣传语,15-20个字以内,不要加引号"},
],
给模型下指令。 system 角色相当于"设定规则的人",告诉模型你要它干什么。这里就是让它写一句奶茶宣传语,字数控制在15-20字,别加引号。
temperature=1,