Compare commits
1 Commits
claude/ama
...
rewrite/fi
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f5d926808 |
@ -20,4 +20,23 @@ describe("resolveDeploymentModel", () => {
|
||||
resolveDeploymentModel({ OPENROUTER_API_KEY: "or-key", PI_DEFAULT_PROVIDER: "anthropic" }),
|
||||
).toEqual({ provider: "anthropic", model: "claude-sonnet-5", key: undefined });
|
||||
});
|
||||
|
||||
it("treats configured local models as a keyless deployment", () => {
|
||||
expect(
|
||||
resolveDeploymentModel({
|
||||
PI_DEFAULT_PROVIDER: "local",
|
||||
PI_DEFAULT_MODEL: "qwen3-coder-30b-a3b",
|
||||
RAKAZO_LOCAL_MODELS: "qwen3-coder-30b-a3b",
|
||||
}),
|
||||
).toEqual({
|
||||
provider: "local",
|
||||
model: "qwen3-coder-30b-a3b",
|
||||
key: "local",
|
||||
});
|
||||
expect(resolveDeploymentModel({ PI_DEFAULT_PROVIDER: "local" })).toEqual({
|
||||
provider: "local",
|
||||
model: "qwen3-coder-30b-a3b",
|
||||
key: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -11,13 +11,17 @@ export function resolveDeploymentModel(env: NodeJS.ProcessEnv = process.env) {
|
||||
// A row per provider that ships a deployment key. A third one adds a row here, not a
|
||||
// branch at each call site — and an unknown provider gets no key rather than another
|
||||
// vendor's, which a ternary on one provider would not give.
|
||||
// Local OpenAI-compatible servers are keyless; a placeholder still counts as a
|
||||
// deployment key so the model gate and executor fallback treat them as configured.
|
||||
const keys: Record<string, string | undefined> = {
|
||||
openrouter: env.OPENROUTER_API_KEY,
|
||||
anthropic: env.ANTHROPIC_API_KEY,
|
||||
local: env.RAKAZO_LOCAL_MODELS?.trim() ? "local" : undefined,
|
||||
};
|
||||
const models: Record<string, string> = {
|
||||
openrouter: DEFAULT_OPENROUTER_MODEL_ID,
|
||||
anthropic: "claude-sonnet-5",
|
||||
local: "qwen3-coder-30b-a3b",
|
||||
};
|
||||
return {
|
||||
provider,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user