Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

Windows本地部署,请求耗时过长 #312

@Bedingled403

Description

@Bedingled403

Please make sure of the following things

  • 我已经阅读了错误自查

  • 我确定没有重复的issue或讨论。

  • 我确定是Hajimi自身的问题,而不是酒馆等三方件的原因。

  • 我确定这个问题在最新版本中没有被修复。

hajimi版本

v1.0.9,3712ba496c9d16a62f4017fbeb41d6d3bd36bb5b

问题描述

对比了直接访问官方接口、爪云部署、Windows本地部署(AI Studio 轮询)这三种方式的速度,使用 gemini-2.0-flash

  • 官方接口:接近2s
  • 爪云:接近3s
  • 本地部署:12s

终端日志显示Run time of job "ActiveRequestsManager.clean_completedRun time of job "ResponseCacheManager.clean_expired,可能与此有关?🤔

复现方法

  1. 使用Windows双击这里运行.ps1,Windows本地部署运行
  2. 使用接口http://127.0.0.1:7860

系统及硬件信息

Logs / 日志

正在启动 Hajimi 应用...
您现在可以通过 http://localhost:7860 或 http://<您的IP>:7860 访问
按 Ctrl+C 停止应用。
[2025-09-21 06:58:20] [INFO] []--[]: Using credentials directory: ./hajimi\credentials
[2025-09-21 06:58:20] [INFO] []--[]: Using API Key authentication
[2025-09-21 06:58:20] [INFO] []--[]: Using GOOGLE_CREDENTIALS_JSON environment variable for authentication
[2025-09-21 06:58:20] [INFO] []--[]: Using models config URL: https://raw.githubusercontent.com/gzzhongqi/vertex2openai/refs/heads/main/vertexModels.json
[2025-09-21 06:58:20] [INFO] []--[]: Fake streaming is enabled with interval 1.0 seconds, chunk size 10, delay per chunk 0.1 seconds
INFO:     Started server process [19436]
INFO:     Waiting for application startup.
[2025-09-21 06:58:20] [INFO] []--[]: 重新加载了GOOGLE_CREDENTIALS_JSON配置
[2025-09-21 06:58:20] [INFO] []--[]: 重新加载了API Key配置
[2025-09-21 06:58:20] [INFO] []--[]: Using provided CredentialManager instance
[2025-09-21 06:58:20] [INFO] []--[]: Found GOOGLE_CREDENTIALS_JSON environment variable. Attempting to load into CredentialManager.
[2025-09-21 06:58:20] [DEBUG] []--[]: Parsed 0 credential objects from the input string.
[2025-09-21 06:58:20] [DEBUG] []--[]: Multi-JSON loading from GOOGLE_CREDENTIALS_JSON did not add to manager or was empty. Attempting single JSON load.
[2025-09-21 06:58:20] [WARNING] []--[]: GOOGLE_CREDENTIALS_JSON could not be parsed as a single JSON object: Expecting value: line 1 column 1 (char 0).
[2025-09-21 06:58:20] [INFO] []--[]: Attempting to pre-warm model configuration cache during startup...
[2025-09-21 06:58:20] [INFO] []--[]: Attempting to refresh model configuration cache...
[2025-09-21 06:58:20] [INFO] []--[]: 使用app_config中的MODELS_CONFIG_URL
[2025-09-21 06:58:20] [INFO] []--[]: Fetching model configuration from: https://raw.githubusercontent.com/gzzhongqi/vertex2openai/refs/heads/main/vertexModels.json
[2025-09-21 06:58:30] [INFO] []--[]: 尝试获取模型配置,第1次尝试
[2025-09-21 06:58:31] [DEBUG] []--[]: 接收到原始响应: {
  "vertex_models": [
    "gemini-2.5-pro",
    "gemini-2.5-flash",
    "gemini-2.5-flash-lite-preview-06-17",
    "gemini-2.5-pro-exp-03-25",
    "gemini-2.5-pro-preview-03-25",
    "gemini-2.5-pro-...
[2025-09-21 06:58:31] [INFO] []--[]: 成功获取和解析模型配置。找到 11 个标准模型和 10 个Express模型。
[2025-09-21 06:58:31] [INFO] []--[]: Model configuration cache refreshed successfully.
[2025-09-21 06:58:31] [INFO] []--[]: Model configuration cache pre-warmed successfully.
[2025-09-21 06:58:31] [DEBUG] []--[]: Refresh check - Total credentials available: 0
[2025-09-21 06:58:31] [ERROR] []--[]: Credential Manager reports no available credentials after processing all sources.
[2025-09-21 06:58:34] [INFO] []--[]-: 版本检查: 本地版本 1.0.9, 远程版本 1.0.9, 有更新: False
[2025-09-21 06:58:46] [INFO] []--[]-: 找到第一个有效密钥: ...
[2025-09-21 06:58:57] [INFO] []--[]-: 使用密钥 <密钥>... 加载可用模型成功
[2025-09-21 06:58:57] [INFO] []--[]-: 找到可用浏览器: 。准备打开 URL...
[2025-09-21 06:58:57] [INFO] []--[]-: 已发送打开浏览器指令: http://127.0.0.1:7860
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:7860 (Press CTRL+C to quit)
[2025-09-21 06:59:43] [INFO] []-non-stream-[gemini-2.0-flash]-: 请求缓存键: 60398340...
[2025-09-21 06:59:43] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求开始,使用密钥: <密钥>...
[2025-09-21 06:59:55] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式成功获取响应,进行缓存
[2025-09-21 06:59:55] [INFO] []--[]-: API调用已记录: 秘钥 '<密钥>', 模型 'gemini-2.0-flash', 令牌: 104
[2025-09-21 06:59:55] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求成功
[2025-09-21 07:00:07] [INFO] []-non-stream-[gemini-2.0-flash]-: 请求缓存键: 47ab6da4...
[2025-09-21 07:00:07] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求开始,使用密钥: <密钥>...
[2025-09-21 07:00:19] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式成功获取响应,进行缓存
[2025-09-21 07:00:19] [INFO] []--[]-: API调用已记录: 秘钥 '<密钥>', 模型 'gemini-2.0-flash', 令牌: 106
[2025-09-21 07:00:19] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求成功
[2025-09-21 07:01:07] [INFO] []-non-stream-[gemini-2.0-flash]-: 请求缓存键: 47ab6da4...
[2025-09-21 07:01:07] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求开始,使用密钥: <密钥>...
[2025-09-21 07:01:19] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式成功获取响应,进行缓存
[2025-09-21 07:01:19] [INFO] []--[]-: API调用已记录: 秘钥 '<密钥>', 模型 'gemini-2.0-flash', 令牌: 106
[2025-09-21 07:01:19] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求成功
[2025-09-21 07:07:26] [INFO] []-non-stream-[gemini-2.0-flash]-: 请求缓存键: 60398340...
[2025-09-21 07:07:26] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求开始,使用密钥: <密钥>...
Run time of job "ActiveRequestsManager.clean_completed (trigger: interval[0:00:30], next run at: 2025-09-21 14:08:01 CST)" was missed by 0:00:06.188424
Run time of job "ResponseCacheManager.clean_expired (trigger: interval[0:01:00], next run at: 2025-09-21 14:08:31 CST)" was missed by 0:00:06.189863
[2025-09-21 07:07:38] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式成功获取响应,进行缓存
[2025-09-21 07:07:38] [INFO] []--[]-: API调用已记录: 秘钥 '<密钥>', 模型 'gemini-2.0-flash', 令牌: 104
[2025-09-21 07:07:38] [INFO] [<密钥>]-fake-stream-[gemini-2.0-flash]-: 假流式请求成功

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions