Skip to content

AI-native design editor. Open-source Figma alternative.

Move AI models to @open-pencil/core constants, add Kimi K2.5 (vision+code), benchmark-ranked tags

Danila Poyarkov4032108be036
diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts
index 26873e350..c301bb516 100644
--- a/packages/core/src/constants.ts
+++ b/packages/core/src/constants.ts
@@ -72,3 +72,33 @@ export const RULER_MAJOR_TOLERANCE = 0.01
export const TEXT_SELECTION_COLOR = { r: 0.26, g: 0.52, b: 0.96, a: 0.3 }
export const TEXT_CARET_COLOR = { r: 0, g: 0, b: 0, a: 1 }
export const TEXT_CARET_WIDTH = 1
+
+export interface ModelOption {
+ id: string
+ name: string
+ provider: string
+ tag?: string
+}
+
+export const AI_MODELS: ModelOption[] = [
+ // Best for design: vision + frontend + tool calling (WebDev Arena #1, DesignBench, SWE-bench 79.6%)
+ { id: 'anthropic/claude-sonnet-4.6', name: 'Claude Sonnet 4.6', provider: 'Anthropic', tag: 'Best for design' },
+ { id: 'anthropic/claude-opus-4.6', name: 'Claude Opus 4.6', provider: 'Anthropic', tag: 'Smartest' },
+ // 76.8% SWE-bench, vision + UI-to-code specialist
+ { id: 'moonshotai/kimi-k2.5', name: 'Kimi K2.5', provider: 'Moonshot', tag: 'Vision + code' },
+ // 1M context, multimodal (text+image+audio+video), 78% SWE-bench
+ { id: 'google/gemini-3.1-pro-preview', name: 'Gemini 3.1 Pro', provider: 'Google', tag: '1M context' },
+ // 80% SWE-bench, 400K context, agentic coding
+ { id: 'openai/gpt-5.3-codex', name: 'GPT-5.3 Codex', provider: 'OpenAI' },
+
+ // Fast & cheap
+ { id: 'google/gemini-3-flash-preview', name: 'Gemini 3 Flash', provider: 'Google', tag: 'Fast' },
+ { id: 'deepseek/deepseek-v3.2', name: 'DeepSeek V3.2', provider: 'DeepSeek', tag: 'Cheap' },
+ { id: 'qwen/qwen3.5-flash-02-23', name: 'Qwen 3.5 Flash', provider: 'Qwen', tag: 'Cheap' },
+
+ // Free (with tool calling)
+ { id: 'qwen/qwen3-coder:free', name: 'Qwen3 Coder', provider: 'Qwen', tag: 'Free' },
+ { id: 'openai/gpt-oss-120b:free', name: 'GPT-OSS 120B', provider: 'OpenAI', tag: 'Free' },
+]
+
+export const DEFAULT_AI_MODEL = AI_MODELS[0].id
diff --git a/src/composables/use-chat.ts b/src/composables/use-chat.ts
index 913d0adab..5ddb6eb0f 100644
--- a/src/composables/use-chat.ts
+++ b/src/composables/use-chat.ts
@@ -1,4 +1,5 @@
import { Chat } from '@ai-sdk/vue'
+import { DEFAULT_AI_MODEL } from '@open-pencil/core'
import { createOpenRouter } from '@openrouter/ai-sdk-provider'
import { DirectChatTransport, ToolLoopAgent } from 'ai'
import dedent from 'dedent'
@@ -6,50 +7,12 @@ import { computed, ref, watch } from 'vue'
import type { UIMessage } from 'ai'
+export { AI_MODELS as MODELS } from '@open-pencil/core'
+export type { ModelOption } from '@open-pencil/core'
+
const API_KEY_STORAGE = 'open-pencil:openrouter-api-key'
const MODEL_STORAGE = 'open-pencil:model'
-export interface ModelOption {
- id: string
- name: string
- provider: string
- tag?: string
-}
-
-export const MODELS: ModelOption[] = [
- // Frontier
- {
- id: 'anthropic/claude-sonnet-4.6',
- name: 'Claude Sonnet 4.6',
- provider: 'Anthropic',
- tag: 'Recommended'
- },
- {
- id: 'anthropic/claude-opus-4.6',
- name: 'Claude Opus 4.6',
- provider: 'Anthropic',
- tag: 'Smartest'
- },
- {
- id: 'google/gemini-3.1-pro-preview',
- name: 'Gemini 3.1 Pro',
- provider: 'Google',
- tag: '1M context'
- },
- { id: 'openai/gpt-5.3-codex', name: 'GPT-5.3 Codex', provider: 'OpenAI' },
-
- // Fast & cheap
- { id: 'google/gemini-3-flash-preview', name: 'Gemini 3 Flash', provider: 'Google', tag: 'Fast' },
- { id: 'qwen/qwen3.5-flash-02-23', name: 'Qwen 3.5 Flash', provider: 'Qwen', tag: 'Cheap' },
- { id: 'deepseek/deepseek-v3.2', name: 'DeepSeek V3.2', provider: 'DeepSeek', tag: 'Cheap' },
-
- // Free
- { id: 'qwen/qwen3-coder:free', name: 'Qwen3 Coder', provider: 'Qwen', tag: 'Free' },
- { id: 'openai/gpt-oss-120b:free', name: 'GPT-OSS 120B', provider: 'OpenAI', tag: 'Free' }
-]
-
-export const DEFAULT_MODEL = MODELS[0].id
-
const SYSTEM_PROMPT = dedent`
You are a design assistant inside OpenPencil, a Figma-like design editor.
Help users create and modify designs. Be concise and direct.
@@ -57,7 +20,7 @@ const SYSTEM_PROMPT = dedent`
`
const apiKey = ref(localStorage.getItem(API_KEY_STORAGE) ?? '')
-const modelId = ref(localStorage.getItem(MODEL_STORAGE) ?? DEFAULT_MODEL)
+const modelId = ref(localStorage.getItem(MODEL_STORAGE) ?? DEFAULT_AI_MODEL)
const activeTab = ref<'design' | 'ai'>('design')
watch(apiKey, (key) => {
diff --git a/tests/e2e/chat-panel.spec.ts b/tests/e2e/chat-panel.spec.ts
index e9312ef1e..51cf65e20 100644
--- a/tests/e2e/chat-panel.spec.ts
+++ b/tests/e2e/chat-panel.spec.ts
@@ -138,7 +138,7 @@ test('model selector is visible and clickable', async () => {
await trigger.click()
await expect(page.getByRole('option', { name: /Claude Sonnet 4\.6/ })).toBeVisible()
- await expect(page.getByText('Recommended')).toBeVisible()
+ await expect(page.getByText('Best for design')).toBeVisible()
await expect(page.getByText('Free').first()).toBeVisible()
await page.keyboard.press('Escape')