Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Models fetching issue: models.dev matching fails for providers with a templated API URL (e.g. Cloudflare Workers AI), so no models are discovered

未关闭
#662 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
clojure
领域
ai, backend

调研方向

Start by finding the models.dev provider matching code and tracing how it compares configured API URLs with provider entries. Reproduce the Cloudflare Workers AI case using the templated URL and the /models 405 response described here. Done means the provider is matched through a reliable approach and its models are discovered without relying on the unavailable endpoint.

由索引模型根据 Issue 内容生成。

描述

Cloudflare Workers AI use a custom value in a path of the URL, that is the account ID:

    "cloudflare-workers-ai": {
      "api": "openai-chat",
      "url": "https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1",
      "key": "api_key"
    }

Then it seems it does not match API URL of models.dev, since it's templated:

curl -s https://models.dev/api.json | jq '."cloudflare-workers-ai".api'
"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1"

And since it does not match, according to the docs, it seems to try the /models endpoint, that does not exist in this provider:

01:23:18.394 WARN [MODELS] Provider 'cloudflare-workers-ai': /models endpoint returned status 405: {"result":null,"success":false,"errors":[{"code":7001,"message":"GET not supported for requested URI."}],"messages":[]}

One solution would be to fallback to provider id if URL match fails:

 curl -s https://models.dev/api.json   | jq '."cloudflare-workers-ai".id'
"cloudflare-workers-ai"

Another could be treating the template part ${...} as wildcards when matching, so it would be ignored.

Then it would match the correct entry of models.dev.

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

主要语言
Clojure
星标
1k
派生
82
平均合并
1 天 20 小时
30 天内合并 PR
18

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

editor-code-assistant/eca 的其他 Issue

查看 editor-code-assistant/eca 的全部 Issue

相似的 Issue

更多 Clojure Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。