Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(playground): dedupe filteredModels to avoid duplicate React key warning

diegosouzapw5ef348225420
diff --git a/src/app/(dashboard)/dashboard/playground/page.tsx b/src/app/(dashboard)/dashboard/playground/page.tsx
index 1b2a728188..96b51e14a8 100644
--- a/src/app/(dashboard)/dashboard/playground/page.tsx
+++ b/src/app/(dashboard)/dashboard/playground/page.tsx
@@ -291,9 +291,17 @@ export default function PlaygroundPage() {
.catch(() => {});
}, []);
- const filteredModels = models
- .filter((m) => !selectedProvider || m.id.startsWith(selectedProvider + "/"))
- .map((m) => ({ value: m.id, label: m.id }));
+ const filteredModels = (() => {
+ const seen = new Set<string>();
+ const out: Array<{ value: string; label: string }> = [];
+ for (const m of models) {
+ if (selectedProvider && !m.id.startsWith(selectedProvider + "/")) continue;
+ if (seen.has(m.id)) continue;
+ seen.add(m.id);
+ out.push({ value: m.id, label: m.id });
+ }
+ return out;
+ })();
const generateDefaultBody = (endpoint: string, model: string) => {
const template = { ...DEFAULT_BODIES[endpoint] };