目 录CONTENT

文章目录

体验火山引擎的大模型

Administrator
2025-02-15 / 0 评论 / 0 点赞 / 9 阅读 / 0 字

火山方舟:平台提供模型精调、推理、评测等全方位功能与服务,提供丰富的插件生态和AI原生应用开发服务,并通过安全可信的基础设施,专业的算法技术服务,全方位保障企业级AI应用落地

最新优惠:免费额度:50万tokens/豆包语言模型 企业客户权益:500万tokens/天 主力模型价格低至:0.8元/百万tokens多模态大模型支持文本、语音、视觉

模型广场:提供豆包全家桶模型、deepseek、Qwen等多模态模型和蒸馏小模型,支持文本、语音、视频等多模态功能;涵盖了多种模型类型、功能、提供方及更新信息。包括字节跳动的多模态大模型Doubao-1.5-vision-pro-32k,具备强大的视觉推理和文本生成能力;DeepSeek的R1和V3模型,在推理和语言能力上表现卓越;智谱AI的GLM3-130B金融模型,针对金融领域优化;以及Moonshot AI的千亿参数语言模型,适用于不同文本长度的场景。这些模型广泛应用于内容创作、智能交互、数据分析等,为企业和开发者提供强大的技术支持。

Prompt调优:生成更好的提示器,使用小红书Prompt,尝试带货提示词

在线推理:一般我们是在第三方服务端使用的在线推理,也就是大家常用的大模型服务页面的功能

API KEY管理:在第三方服务请求火山引擎方舟服务,调用大模型功能的重要凭据

开通模型:在调用模型前,需要在管理页面开通模型服务

模型接入点:创建个人的模型调用服务,选中的模型只能是上步已经开通的模型

在cherry studio验证

实验结果:尽管是DeepSeek-R1的满血版本,但是缺少联网搜索,依然缺乏可靠性

代码SDK调试

import httpx
from volcenginesdkarkruntime import Ark
# Authentication
# 1.If you authorize your endpoint using an API key, you can set your api key to environment variable "ARK_API_KEY"
# or specify api key by Ark(api_key="${YOUR_API_KEY}").
# Note: If you use an API key, this API key will not be refreshed.
# To prevent the API from expiring and failing after some time, choose an API key with no expiration date.
# 2.If you authorize your endpoint with Volcengine Identity and Access Management(IAM),
# set your api key to environment variable "VOLC_ACCESSKEY", "VOLC_SECRETKEY"
# or specify ak&sk by Ark(ak="${YOUR_AK}", sk="${YOUR_SK}").
# To get your ak&sk, please refer to this document(https://www.volcengine.com/docs/6291/65568)
# For more information,please check this document(https://www.volcengine.com/docs/82379/1263279)
client = Ark(    
    # The output time of the reasoning model is relatively long. Please increase the timeout period.
    timeout=httpx.Timeout(timeout=1800),
)
if __name__ == "__main__":
    # [Recommended] Streaming:
    print("----- streaming request -----")
    stream = client.chat.completions.create(
        model="{需要使用目标模型}",
        messages=[
            {"role": "user", "content": "常见的十字花科植物有哪些?"},
        ],
        stream=True
    )
    for chunk in stream:
        if not chunk.choices:
            continue
        if chunk.choices[0].delta.reasoning_content:
            print(chunk.choices[0].delta.reasoning_content, end="")
        else:
            print(chunk.choices[0].delta.content, end="")
    print()
    # Non-streaming:
    print("----- standard request -----")
    completion = client.chat.completions.create(
        model="ep-20250215113206-pnfvr",
        messages=[
            {"role": "user", "content": "常见的十字花科植物有哪些?"},
        ],
    )
    print(completion.choices[0].message.reasoning_content)
    print(completion.choices[0].message.content)

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区