如何使用代码示例开始使用 Dell Pro AI Studio

Summary: 了解可帮助开发人员和 IT 专业人员开始利用 Dell Pro AI Studio 的强大功能的基本代码示例。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

Dell Pro AI Studio 是一款功能全面的工具包,旨在简化并加速戴尔 AI PC 上 AI 应用程序的开发、部署和管理。


受影响的产品:

  • Dell Pro AI Studio

我的程序目前使用 OpenAI API,并设置为使用云服务。如何过渡到使用戴尔 Pro AI Studio 本地模型和计算?

戴尔 Pro AI Studio 旨在将某些工作负载直接迁移到本地计算。如果您当前的 AI 应用程序正在使用 OpenAI API 配置,您可能有一些类似于以下代码的代码:

Python 代码示例:

client = OpenAI(
base_url="https://your-custom-endpoint",
api_key="your-api-key",
)
提醒:
  • your-custom-endpoint = 自定义终端节点的 URL
  • your-api-key = AI 的 API 密钥

安装 Dell Pro AI Studio 后,您可以将应用程序配置从上面更改为下面。

Python 代码示例:

client = OpenAI(
    base_url="http://localhost:8553/v1/openai",
    api_key="dpais"
)

我的应用程序需要流媒体功能,Dell Pro AI Studio Framework 是否支持流媒体?

绝对!通常,代码需要在函数调用中添加 Stream 关键字参数。

使用 Phi 3.5 的 Http 代码示例:

{
        "model": "phi3.5",
        "messages": [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user",   "content": "Hello"},
        ],
        "stream": "true"
    }

Python 代码示例:

messages=[{"role": "system", "content": "You are concise."},
                {"role": "user",   "content": "Say hi"}]
resp = client.chat.completions.create(
            model=Phi3.5,
            messages=messages,
            stream=True,
        )

Affected Products

Dell Pro AI Studio
Article Properties
Article Number: 000322409
Article Type: How To
Last Modified: 24 Oct 2025
Version:  2
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.