惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
罗磊的独立博客
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
V
V2EX
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
量子位
MyScale Blog
MyScale Blog
G
Google Developers Blog
M
MIT News - Artificial intelligence
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
B
Blog

V2EX

我用 AI 写代码,但终端管理反而成了累赘——于是我做了 codux [调研] 各位在公司都用什么 ide 和 agent 写代码? 老运维 share 一个运维平台 看到有公司考核 token 指标,很好奇大家上个月的 AI 账单是多少 GLM-Coding 调用持续报错: z.ai 的 Lite 套餐几乎无法使用,官方 Pro/Max 是否稳定? 现在还有什么渠道可以稳定安全地使用 Claude 吗? 上海漕河泾内推,本组有 2 个 hc,一个后端,一个前端,预算都是 20k 左右,不打卡,氛围好 如果 V2EX 上有一组不永久保存聊天记录(比如只保存 7 天或者 24 小时)的聊天室,那么会开启哪些有用或者有趣的可能? gemini cli 貌似挂了,一直返回 403 第一次在自媒体上赚到钱 收集了最近在使用的低价 GPT, Gemini,邮箱等 AI 会员的小店合集 讨论个大实话:现在企业还在说 AI 编程提效 20%, 30%的,真的太落后,没用懂 AI。因为包括很多前沿公司,已经狂奔到提效 200%-500%的情况 [招聘][远程][币安] 前端/后端/QA/iOS/Android 至少 3 年以上经验 目前有大量 HC 欢迎投递 Chatgpt Pro 用量用不完的可以开这些设置 面试的时候好像遇到钓鱼了,给各位避个坑 cursor 年续费 22 号到期, 自动续费是否还是老的计次套餐呢 被两件破事毁掉的一下午,琐碎的内耗消磨人的精力 使用 Planet 存储 Codex 的会话或者重要信息 如果业务部门领导不要你开发功能,而是要求你教会它用 claude code 开发功能,你会怎么做? 分享一个 MacOS 接绿联 CM818 USB 转 DP 转接器使用感受 我的 HR 朋友 10 年老 Java ,非全大专,大家帮忙看看简历 开源了一个 AI 口语练习工具,音素级发音评分,完全免费可自部署 V2EX 上有哪些你觉得很有趣、印象深刻的妹纸? 字节为啥不出个国内版 Vercel? 有在大马的朋友吗? 问个运营商问题 你们在有领导的公司大群发过的最大胆的消息是什么 公司裁员,目前没有工作。想试试摆摊,做一个移动鲜啤打酒车 我的硬盘 Memblaze Pblaze 5 Linux 下不识别,给 Linux 内核提交了补丁, AI 说有望被合并 只有我一个人觉得 codex 不好用?
Google 云平台 Vertex AI 服务 流式输出非常慢, gemini-3-pr...
xuliang12187 · 2025-12-12 · via V2EX

问题描述 当从位于美国硅谷的基础设施向 Vertex AI API ( aiplatform.googleapis.com ) 模型: gemini-3-pro-preview 发起流式预测调用时,我们观察到响应流中首个 Token 的延迟异常偏高。首 Token 延迟( TTFT )持续超过 17 秒,而通常情况应低于 2 秒。

server address: 142.250.191.42

1 、Basic Ping Tests (Connectivity & Baseline Latency) Run these commands from the affected server/client in Silicon Valley. ping(base) [root@usa-gg-test01 ~]# ping aiplatform.googleapis.com PING aiplatform.googleapis.com (142.250.191.42) 56(84) bytes of data. 64 bytes from nuq04s42-in-f10.1e100.net (142.250.191.42): icmp_seq=1 ttl=118 time=2.67 ms 64 bytes from nuq04s42-in-f10.1e100.net (142.250.191.42): icmp_seq=2 ttl=118 time=2.62 ms 64 bytes from nuq04s42-in-f10.1e100.net (142.250.191.42): icmp_seq=3 ttl=118 time=2.64 ms

2 、python code test Using the model:gemini-3-pro-preview

import requests import json import time

def stream_gemini_content(): api_key='xxx' url = "https://aiplatform.googleapis.com/v1/publishers/google/models/gemini-3-pro-preview:streamGenerateContent?alt=sse"

headers = {
    "x-goog-api-key": api_key,
    "Content-Type": "application/json"
}

data = {
    "contents": [{
        "role": "user",
        "parts": [{
            "text": "请讲一个 200 字的故事,不要用推理,直接回答。"
        }]
    }],
    "generationConfig": {
        "thinkingConfig": {
            "includeThoughts": False
        }
    }
}

print(f"begin requests: {url} ...")

start_time = time.time()
first_token_time = None
last_chunk_time = None  

try:
    with requests.post(url, headers=headers, json=data, stream=True) as response:

        if response.status_code != 200:
            print(f"status: {response.status_code}")
            print(response.text)
            return

        print("-" * 50)

        for line in response.iter_lines():
            if not line:
                continue

            decoded_line = line.decode('utf-8').strip()
            if not decoded_line.startswith("data: "):
                continue

            json_str = decoded_line[6:]
            if json_str == "[DONE]":
                break

            try:
                now = time.time()

                if first_token_time is None:
                    first_token_time = now
                    print(f"\n[total] frist token TTFT: {(now - start_time) * 1000:.2f} ms")
                    print("-" * 50)
                    last_chunk_time = now  

                chunk_data = json.loads(json_str)
                candidates = chunk_data.get("candidates", [])

                total_elapsed = (now - start_time) * 1000
                chunk_gap = (now - last_chunk_time) * 1000 if last_chunk_time else 0
                last_chunk_time = now



                if candidates:
                    content = candidates[0].get("content", {})
                    parts = content.get("parts", [])
                    if parts:
                        text_chunk = parts[0].get("text", "")
                        print(text_chunk, end="", flush=True)

            except Exception as e:
				pass

except Exception as e:
    pass

end_time = time.time()
print("\n\n" + "-" * 50)
print(f"total time: {(end_time - start_time) * 1000:.2f} ms")

if name == "main": stream_gemini_content()

代码测试非常慢,200 个字故事就超过 17s 了