跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com
NVIDIA logo

nemotron-3-120b-a12b

Text Generation • NVIDIA

查看 MarkdownAgent 设置
  • Cloudflare-hosted
  • Function calling
  • Reasoning

NVIDIA Nemotron 3 Super 是一款混合 MoE 模型,在多智能体应用和专用智能体 AI 系统中具有领先的准确率。

模型信息
上下文窗口 ↗256,000 个 token
条款和许可证链接 ↗
函数调用 ↗是
推理是
单位定价$0.50 per M input tokens, $1.50 per M output tokens

试用环境

使用 Workers AI LLM Playground 试用此模型。无需设置或身份验证,即可直接在浏览器中预览和测试模型。

启动 LLM Playground

用法


export interface Env {
  AI: Ai;
}

export default {
  async fetch(request, env): Promise<Response> {

    const messages = [
      { role: "system", content: "You are a friendly assistant" },
      {
        role: "user",
        content: "What is the origin of the phrase Hello, World",
      },
    ];

    const stream = await env.AI.run("@cf/nvidia/nemotron-3-120b-a12b", {
      messages,
      stream: true,
    });

    return new Response(stream, {
      headers: { "content-type": "text/event-stream" },
    });
  },
} satisfies ExportedHandler<Env>;

export interface Env {
  AI: Ai;
}

export default {
  async fetch(request, env): Promise<Response> {

    const messages = [
      { role: "system", content: "You are a friendly assistant" },
      {
        role: "user",
        content: "What is the origin of the phrase Hello, World",
      },
    ];
    const response = await env.AI.run("@cf/nvidia/nemotron-3-120b-a12b", { messages });

    return Response.json(response);
  },
} satisfies ExportedHandler<Env>;

import os
import requests

ACCOUNT_ID = "your-account-id"
AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")

prompt = "Tell me all about PEP-8"
response = requests.post(
  f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/nvidia/nemotron-3-120b-a12b",
    headers={"Authorization": f"Bearer {AUTH_TOKEN}"},
    json={
      "messages": [
        {"role": "system", "content": "You are a friendly assistant"},
        {"role": "user", "content": prompt}
      ]
    }
)
result = response.json()
print(result)

curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/nvidia/nemotron-3-120b-a12b \
  -X POST \
  -H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \
  -d '{ "messages": [{ "role": "system", "content": "You are a friendly assistant" }, { "role": "user", "content": "Why is pizza so good" }]}'

参数

输入

prompt
stringrequiredminLength: 1供模型生成响应的输入文本提示词。
model
string要使用的模型 ID(例如 '@cf/zai-org/glm-4.7-flash, etc')。
frequency_penalty
number | null根据新 token 在已有文本中的出现频率对其施加惩罚。
logit_bias
object | null调整指定 token 出现在补全结果中的可能性。将 token ID 映射到 -100 到 100 之间的偏置值。
logprobs
boolean | null是否返回输出 token 的对数概率。
top_logprobs
integer | null在每个 token 位置返回的最高对数概率数量(0-20)。需要 logprobs=true。
max_tokens
integer | null已弃用,请改用 max_completion_tokens。要生成的最大 token 数。
max_completion_tokens
integer | null补全可生成的 token 数上限。
metadata
object | null可附加到对象上的 16 个键值对集合。
modalities
array | null请求模型输出的类型(例如 ['text'] 或 ['text', 'audio'])。
n
integer | null为每条输入消息生成的聊天补全选项数量。
parallel_tool_calls
booleandefault: true使用工具时是否启用并行函数调用。
presence_penalty
number | null根据新 token 是否已在文本中出现过对其施加惩罚。
reasoning_effort
string | null限制推理模型(o1、o3-mini 等)在推理上投入的力度。
seed
integer | null如果指定,系统将尽力以确定性方式进行采样。
service_tier
string | null指定处理请求时使用的处理类型。
store
boolean | null是否存储输出以用于模型蒸馏/评估。
stream
boolean | null若为 true,部分消息增量将以服务器发送事件(server-sent events)的形式发送。
temperature
number | null采样温度,取值介于 0 到 2 之间。
top_p
number | null核采样:仅考虑累计概率质量达到 top_p 的 token。
user
string代表您的最终用户的唯一标识符,用于滥用监控。

输出

Synchronous — Send a request and receive a complete response
id
string聊天补全的唯一标识符。
object
string
created
integer补全创建时间的 Unix 时间戳(秒)。
model
string聊天补全所使用的模型。
system_fingerprint
string | null
service_tier
string | null
Streaming — Send a request with `stream: true` and receive server-sent events
type
string
contentType
text/event-stream
format
binary

API schema(原始)

Synchronous输入
Synchronous输出
Streaming输入
Streaming输出

这篇文档对您有帮助吗?