provider: Fireworks Nexus preset, Nexus Auto on all three APIs (CNSA0422 on X)
Fireworks Nexus is an account and plan of its own (nexus.fireworks.ai, Pro $8, Team, Enterprise) on the platform's /inference endpoints, which speak chat completions, Responses and Anthropic messages (docs.fireworks.ai/nexus/apis-and-sdks). Its keys are made at nexus.fireworks.ai/settings/api-keys; a platform key carries no Nexus plan. The new preset fireworks-nexus (Add sheet tile "Nexus", the Fireworks logo) sets all three endpoints and lists only `auto`: Pro and Team refuse an open model named directly with a 403 (nexus/open-models), so the platform's /models would offer models the plan refuses, and no list is asked for. Enterprise users type their open models in, or set a models URL. The editor offers x-anthropic-api-key and x-openai-api-key, the headers Nexus Auto takes the user's own Claude and OpenAI keys in. No usage API is documented (only the nexus.fireworks.ai/usage dashboard), so there is no usage card. READMEs (en, zh) and docs/reference.md list it. Run (mote): go test -run 'TestFireworksNexus|Preset' ./internal/provider ok at the pushed head; go test -count=1 -timeout 45m ./internal/provider ./internal/gui ./internal/catalog at the pre-rebase base: provider and catalog ok, gui red only in the real-window AppKit tests killed at their deadline under mote's load (TestCoveredWindowStaysUp, TestClosingWindowMarksPageOutOfSight, TestPanelHiddenByWailsMarksPageOutOfSight; #2645, #4924, #4125). gofmt clean; go vet darwin, linux (nogui) and windows of internal/provider. Broken by hand: without NoList TestFireworksNexusPreset goes red, the fake platform list's accounts/fireworks/models/glm-5p3 listed and its /models asked. Not tried: a real Nexus key (none here), so neither `auto` on each API, the header passthrough, nor what /models answers for a Nexus key; the `auto` context window is left to the catalog (Nexus CLI writes 1M/131K). GUI suite not run: presets reach the Add sheet as data and no GUI file names a preset list.
This commit is contained in:
@@ -152,7 +152,7 @@ The cost: the model sees `{{API_KEY_…}}`, not the key, so a task about the val
|
||||
|
||||
Pick a preset, paste a key. Model lists come from the vendor, with names and reasoning levels filled in from [models.dev](https://models.dev), so a model released this morning is in your picker on the next refresh.
|
||||
|
||||
> **Presets include** Anthropic · OpenAI · Google Gemini · Google Vertex AI · Amazon Bedrock (runtime and Mantle) · DeepSeek · Kimi · Zhipu GLM · MiniMax · StepFun · LongCat · Qwen · Baidu Qianfan · Tencent Cloud · Huawei Cloud MaaS · Volcengine Ark · Mistral · Voyage AI · Groq · Nous Portal · xAI · OpenRouter · Vercel AI Gateway · Together · Fireworks · SiliconFlow · NVIDIA NIM · ModelScope · Ollama · LM Studio … and any OpenAI- or Anthropic-compatible URL.
|
||||
> **Presets include** Anthropic · OpenAI · Google Gemini · Google Vertex AI · Amazon Bedrock (runtime and Mantle) · DeepSeek · Kimi · Zhipu GLM · MiniMax · StepFun · LongCat · Qwen · Baidu Qianfan · Tencent Cloud · Huawei Cloud MaaS · Volcengine Ark · Mistral · Voyage AI · Groq · Nous Portal · xAI · OpenRouter · Vercel AI Gateway · Together · Fireworks · Fireworks Nexus · SiliconFlow · NVIDIA NIM · ModelScope · Ollama · LM Studio … and any OpenAI- or Anthropic-compatible URL.
|
||||
|
||||
**Import** brings in the providers from CC Switch, Claude Code, Codex and Alma. **[Add to magpie](https://usemagpie.ai/docs/import)** links let a provider's website hand its config to magpie in one click. Each key and each account can go through a proxy of its own.
|
||||
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ Agent 会把读到的东西放进提示词:一个 `.env`、一份配置、一
|
||||
|
||||
选一个预设,粘贴 key。模型列表直接来自厂商,名称和推理档位从 [models.dev](https://models.dev) 补全,今天早上刚发布的模型,下次刷新就出现在你的选择器里。
|
||||
|
||||
> **预设包括** Anthropic · OpenAI · Google Gemini · Amazon Bedrock(runtime 与 Mantle)· DeepSeek · Kimi · 智谱 GLM · MiniMax · 阶跃星辰 · LongCat · 通义千问 · 百度千帆 · 腾讯云 · 华为云 MaaS · 火山方舟 · Mistral · Voyage AI · Groq · Nous Portal · xAI · OpenRouter · Vercel AI Gateway · Together · Fireworks · 硅基流动 · NVIDIA NIM · 魔搭 · Ollama · LM Studio …… 以及任何兼容 OpenAI 或 Anthropic 的地址。
|
||||
> **预设包括** Anthropic · OpenAI · Google Gemini · Amazon Bedrock(runtime 与 Mantle)· DeepSeek · Kimi · 智谱 GLM · MiniMax · 阶跃星辰 · LongCat · 通义千问 · 百度千帆 · 腾讯云 · 华为云 MaaS · 火山方舟 · Mistral · Voyage AI · Groq · Nous Portal · xAI · OpenRouter · Vercel AI Gateway · Together · Fireworks · Fireworks Nexus · 硅基流动 · NVIDIA NIM · 魔搭 · Ollama · LM Studio …… 以及任何兼容 OpenAI 或 Anthropic 的地址。
|
||||
|
||||
**导入**能读取你在 CC Switch、Claude Code、Codex 和 Alma 里配置的 provider。[**「添加到 magpie」链接**](https://usemagpie.ai/docs/zh/import)让 provider 网站一键把配置交给 magpie。每个 key 和每个账号都可以走自己的代理。
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ line; agents connected to magpie lose it when it quits.
|
||||
- **Providers with one field.** Pick a preset (Anthropic, OpenAI, Gemini,
|
||||
Amazon Bedrock and its Mantle endpoint, DeepSeek, Kimi, GLM, MiniMax, StepFun, LongCat, Qwen, Baidu Qianfan, Tencent Cloud Token Plan,
|
||||
Huawei Cloud MaaS, Volcengine Ark, Mistral, Groq, Nous Portal, xAI, OpenRouter, Together,
|
||||
Fireworks, SiliconFlow, NVIDIA NIM, ModelScope, AiHubMix, PipeLLM, 302.AI, Ollama, LM Studio…),
|
||||
Fireworks, Fireworks Nexus, SiliconFlow, NVIDIA NIM, ModelScope, AiHubMix, PipeLLM, 302.AI, Ollama, LM Studio…),
|
||||
paste a key, done. Custom vendors need a name and a base URL. magpie never
|
||||
reads keys from your shell environment.
|
||||
- **Real model lists, nothing compiled in.** With a key in hand magpie asks
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"slices"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Fireworks Nexus (CNSA0422 on X) is the platform's /inference API with a
|
||||
// key from nexus.fireworks.ai, on all three APIs. Pro and Team refuse every
|
||||
// model but `auto` (docs.fireworks.ai/nexus/open-models: 403), so `auto` is
|
||||
// its list, and no list is asked for: the platform's would offer models the
|
||||
// plan refuses.
|
||||
func TestFireworksNexusPreset(t *testing.T) {
|
||||
detectHome(t)
|
||||
p, err := FromPreset("fireworks-nexus")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if p.Chat != "https://api.fireworks.ai/inference/v1" || p.Responses != "https://api.fireworks.ai/inference/v1" ||
|
||||
p.Anthropic != "https://api.fireworks.ai/inference" {
|
||||
t.Fatalf("endpoints %q %q %q", p.Chat, p.Responses, p.Anthropic)
|
||||
}
|
||||
if p.KeysURL != "https://nexus.fireworks.ai/settings/api-keys" {
|
||||
t.Fatalf("keys at %q", p.KeysURL)
|
||||
}
|
||||
if pr := Preset("fireworks-nexus"); !slices.Equal(pr.HeaderHints, []string{"x-anthropic-api-key", "x-openai-api-key"}) {
|
||||
t.Fatalf("header hints %v", pr.HeaderHints)
|
||||
}
|
||||
asked := false
|
||||
up := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
asked = true
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"object":"list","data":[{"id":"accounts/fireworks/models/glm-5p3","object":"model"}]}`))
|
||||
}))
|
||||
defer up.Close()
|
||||
p.Key = "fw_test"
|
||||
p.Chat, p.Responses, p.Anthropic = up.URL+"/inference/v1", up.URL+"/inference/v1", up.URL+"/inference"
|
||||
for name, list := range map[string]func() ([]string, error){
|
||||
"fetch": func() ([]string, error) { ms, err := p.fetch(t.Context()); return modelIDs(ms), err },
|
||||
"all": func() ([]string, error) { ms, err := p.ListAll(t.Context()); return modelIDs(ms), err },
|
||||
} {
|
||||
got, err := list()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v", name, err)
|
||||
}
|
||||
if !slices.Equal(got, []string{"auto"}) {
|
||||
t.Fatalf("%s: models %v", name, got)
|
||||
}
|
||||
}
|
||||
if asked {
|
||||
t.Fatal("the platform's /models was asked")
|
||||
}
|
||||
}
|
||||
@@ -602,6 +602,22 @@ var presets = []PresetDef{
|
||||
{ID: "fireworks", Name: "Fireworks", Icon: "fireworks-color", Kind: KindRelay, Catalog: "fireworks-ai",
|
||||
Chat: "https://api.fireworks.ai/inference/v1",
|
||||
Website: "https://fireworks.ai", KeysURL: "https://app.fireworks.ai/settings/users/api-keys"},
|
||||
// Fireworks Nexus (CNSA0422 on X): an account and plan of its own at
|
||||
// nexus.fireworks.ai, with keys made there, on the platform's
|
||||
// /inference endpoints, which speak chat completions, Responses and
|
||||
// messages alike (docs.fireworks.ai/nexus/apis-and-sdks). Pro and Team
|
||||
// take only `auto`, Nexus Auto, and refuse an open model named directly
|
||||
// with a 403 (nexus/open-models), so `auto` is the list; an Enterprise
|
||||
// account's open models are typed in. Nexus Auto reaches Claude and GPT
|
||||
// with the user's own keys in the two headers, or with Provider Keys
|
||||
// set up on the account.
|
||||
{ID: "fireworks-nexus", Name: "Fireworks Nexus", Short: "Nexus", Icon: "fireworks-color", Kind: KindRelay,
|
||||
Chat: "https://api.fireworks.ai/inference/v1", Responses: "https://api.fireworks.ai/inference/v1", Anthropic: "https://api.fireworks.ai/inference",
|
||||
Note: "Nexus Auto · Pro, Team, Enterprise",
|
||||
Website: "https://docs.fireworks.ai/nexus", KeysURL: "https://nexus.fireworks.ai/settings/api-keys",
|
||||
NoList: true,
|
||||
Models: []string{"auto"},
|
||||
HeaderHints: []string{"x-anthropic-api-key", "x-openai-api-key"}},
|
||||
{ID: "siliconflow", Name: "SiliconFlow", Icon: "siliconcloud-color", Kind: KindRelay, Catalog: "siliconflow",
|
||||
Chat: "https://api.siliconflow.cn/v1",
|
||||
Website: "https://cloud.siliconflow.cn", KeysURL: "https://cloud.siliconflow.cn/account/ak",
|
||||
|
||||
Reference in New Issue
Block a user