Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It is designed for researchers, engineers, and students who want to quickly unde
## What It Does ✨

- 📄 Analyze academic paper PDFs.
- 🧠 Generate structured paper summaries with DeepSeek / Jiekou / MiniMax / GLM.
- 🧠 Generate structured paper summaries with DeepSeek / Jiekou / MiniMax / GLM / Xiaomi MiMo.
- 🧮 Render Markdown, tables, and LaTeX formulas clearly.
- 💻 Decide whether the paper needs core code.
- 🧭 Plan a minimal core-code blueprint before writing files.
Expand All @@ -19,7 +19,7 @@ It is designed for researchers, engineers, and students who want to quickly unde

## Core Workflow 🚀

1. Select a provider (DeepSeek / Jiekou / MiniMax / GLM) and enter your API key in the sidebar.
1. Select a provider (DeepSeek / Jiekou / MiniMax / GLM / Xiaomi MiMo) and enter your API key in the sidebar.
2. Choose a model.
3. Select a paper PDF.
4. Start analysis.
Expand Down Expand Up @@ -50,6 +50,7 @@ Paper2CoreCode supports multiple OpenAI-compatible model providers:
- Jiekou: Claude, Gemini 3.1 preview, and GPT 5.5 models that work with the current chat completions endpoint.
- MiniMax: `MiniMax-M2.7`, `MiniMax-M2.7-highspeed`, `MiniMax-M2.5`, `MiniMax-M2.5-highspeed`.
- GLM: `glm-5.1`, `glm-5`, `glm-5-turbo`.
- Xiaomi MiMo: `mimo-v2.5-pro`, `mimo-v2-pro`, `mimo-v2.5`.

API keys and model choices are stored separately for each provider in the local app user data directory. Switching providers reloads that provider's own saved key and model.

Expand All @@ -65,7 +66,7 @@ Version tags like `v0.1.3` trigger the release workflow, which builds platform p

- Electron + TypeScript
- React + Vite
- DeepSeek / Jiekou / MiniMax / GLM APIs (OpenAI-compatible)
- DeepSeek / Jiekou / MiniMax / GLM / Xiaomi MiMo APIs (OpenAI-compatible)
- `pdf-parse`
- `react-markdown` + KaTeX
- `electron-builder`
Expand Down
7 changes: 4 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Paper2CoreCode 是一款桌面端论文阅读与最小核心代码生成工具
## 它能做什么 ✨

- 📄 分析学术论文 PDF。
- 🧠 使用 DeepSeek / Jiekou / MiniMax / GLM 生成结构化论文总结。
- 🧠 使用 DeepSeek / Jiekou / MiniMax / GLM / Xiaomi MiMo 生成结构化论文总结。
- 🧮 清晰渲染 Markdown、表格和 LaTeX 公式。
- 💻 判断论文是否需要生成核心代码。
- 🧭 在写入文件前规划最小核心代码蓝图。
Expand All @@ -19,7 +19,7 @@ Paper2CoreCode 是一款桌面端论文阅读与最小核心代码生成工具

## 核心流程 🚀

1. 在侧边栏选择模型供应商(DeepSeek / Jiekou / MiniMax / GLM)并配置 API Key。
1. 在侧边栏选择模型供应商(DeepSeek / Jiekou / MiniMax / GLM / Xiaomi MiMo)并配置 API Key。
2. 选择模型。
3. 选择论文 PDF。
4. 开始分析。
Expand Down Expand Up @@ -50,6 +50,7 @@ Paper2CoreCode 支持多个 OpenAI-compatible 模型供应商:
- Jiekou:当前 chat completions 流程可用的 Claude、Gemini 3.1 preview 和 GPT 5.5 模型。
- MiniMax:`MiniMax-M2.7`、`MiniMax-M2.7-highspeed`、`MiniMax-M2.5`、`MiniMax-M2.5-highspeed`。
- GLM:`glm-5.1`、`glm-5`、`glm-5-turbo`。
- Xiaomi MiMo:`mimo-v2.5-pro`、`mimo-v2-pro`、`mimo-v2.5`。

API Key 和模型选择会按供应商分别保存在本机应用用户数据目录中。切换供应商时,应用会重新加载该供应商自己的 API Key 和模型。

Expand All @@ -65,7 +66,7 @@ Pull Request 会通过 GitHub Actions 在 Windows、macOS 和 Linux 上运行 `n

- Electron + TypeScript
- React + Vite
- DeepSeek / Jiekou / MiniMax / GLM APIs(OpenAI-compatible)
- DeepSeek / Jiekou / MiniMax / GLM / Xiaomi MiMo APIs(OpenAI-compatible)
- `pdf-parse`
- `react-markdown` + KaTeX
- `electron-builder`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "paper2corecode",
"version": "0.1.3",
"description": "Desktop app to analyze papers and extract core code with DeepSeek / Jiekou / MiniMax / GLM",
"description": "Desktop app to analyze papers and extract core code with DeepSeek / Jiekou / MiniMax / GLM / Xiaomi MiMo",
"author": {
"name": "lemonmindyes",
"email": "lemonmindyes@users.noreply.github.com"
Expand Down
70 changes: 66 additions & 4 deletions src/main/backend/deepseekClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,22 @@ interface GlmModelConfig {
thinking?: { type: 'enabled' }
}

interface MimoModelConfig {
maxTokens?: number
tokenParam?: 'max_tokens' | 'max_completion_tokens'
temperature?: number
topP?: number
frequencyPenalty?: number
presencePenalty?: number
stop?: null
}

const PROVIDER_CONFIGS: Record<string, ProviderConfig> = {
deepseek: { baseURL: 'https://api.deepseek.com/v1' },
jiekou: { baseURL: 'https://api.jiekou.ai/openai' },
minimax: { baseURL: 'https://api.minimaxi.com/v1' },
glm: { baseURL: 'https://open.bigmodel.cn/api/paas/v4' },
mimo: { baseURL: 'https://api.xiaomimimo.com/v1' },
}

const JIEKOU_MODEL_CONFIGS: Record<string, JiekouModelConfig> = {
Expand All @@ -48,6 +59,36 @@ const GLM_MODEL_CONFIGS: Record<string, GlmModelConfig> = {
'glm-5-turbo': { maxTokens: 65536, temperature: 1.0, thinking: { type: 'enabled' } },
}

const MIMO_MODEL_CONFIGS: Record<string, MimoModelConfig> = {
'mimo-v2.5-pro': {
maxTokens: 131072,
tokenParam: 'max_completion_tokens',
temperature: 1.0,
topP: 0.95,
frequencyPenalty: 0,
presencePenalty: 0,
stop: null,
},
'mimo-v2-pro': {
maxTokens: 131072,
tokenParam: 'max_completion_tokens',
temperature: 1.0,
topP: 0.95,
frequencyPenalty: 0,
presencePenalty: 0,
stop: null,
},
'mimo-v2.5': {
maxTokens: 32768,
tokenParam: 'max_completion_tokens',
temperature: 1.0,
topP: 0.95,
frequencyPenalty: 0,
presencePenalty: 0,
stop: null,
},
}

export function loadConfig() {
const config = getActiveSettings()
if (!config.apiKey || config.apiKey.trim() === '') {
Expand Down Expand Up @@ -75,7 +116,9 @@ export async function callDeepSeek(
? JIEKOU_MODEL_CONFIGS[config.model]
: config.provider === 'glm'
? GLM_MODEL_CONFIGS[config.model]
: undefined
: config.provider === 'mimo'
? MIMO_MODEL_CONFIGS[config.model]
: undefined

if (modelCfg && 'unsupportedReason' in modelCfg && modelCfg.unsupportedReason) {
throw new AppError(
Expand All @@ -92,18 +135,21 @@ export async function callDeepSeek(
max_tokens?: number
max_completion_tokens?: number
temperature?: number
top_p?: number
frequency_penalty?: number
presence_penalty?: number
stop?: null
thinking?: { type: string }
} = {
model: config.model,
messages,
stream: true,
}

if (modelCfg?.maxTokens) {
requestBody.max_tokens = modelCfg.maxTokens
}
if (modelCfg && 'tokenParam' in modelCfg && modelCfg.tokenParam && modelCfg.maxTokens) {
requestBody[modelCfg.tokenParam] = modelCfg.maxTokens
} else if (modelCfg?.maxTokens) {
requestBody.max_tokens = modelCfg.maxTokens
}

if (modelCfg && 'temperature' in modelCfg && modelCfg.temperature !== undefined) {
Expand All @@ -114,6 +160,22 @@ export async function callDeepSeek(
requestBody.thinking = modelCfg.thinking
}

if (modelCfg && 'topP' in modelCfg && modelCfg.topP !== undefined) {
requestBody.top_p = modelCfg.topP
}

if (modelCfg && 'frequencyPenalty' in modelCfg && modelCfg.frequencyPenalty !== undefined) {
requestBody.frequency_penalty = modelCfg.frequencyPenalty
}

if (modelCfg && 'presencePenalty' in modelCfg && modelCfg.presencePenalty !== undefined) {
requestBody.presence_penalty = modelCfg.presencePenalty
}

if (modelCfg && 'stop' in modelCfg && modelCfg.stop === null) {
requestBody.stop = null
}

const response = await fetch(`${providerCfg.baseURL}/chat/completions`, {
method: 'POST',
headers: {
Expand Down
4 changes: 4 additions & 0 deletions src/main/backend/settingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export const PROVIDER_SETTINGS: Record<string, { defaultModel: string; models: s
defaultModel: 'glm-5.1',
models: ['glm-5.1', 'glm-5', 'glm-5-turbo'],
},
mimo: {
defaultModel: 'mimo-v2.5-pro',
models: ['mimo-v2.5-pro', 'mimo-v2-pro', 'mimo-v2.5'],
},
}

export interface ActiveSettings {
Expand Down
9 changes: 9 additions & 0 deletions src/renderer/components/SettingsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ const PROVIDERS = [
{ value: 'glm-5-turbo', label: 'GLM 5 Turbo' },
],
},
{
value: 'mimo',
label: 'Xiaomi MiMo',
models: [
{ value: 'mimo-v2.5-pro', label: 'MiMo v2.5 Pro' },
{ value: 'mimo-v2-pro', label: 'MiMo v2 Pro' },
{ value: 'mimo-v2.5', label: 'MiMo v2.5' },
],
},
]

const sectionStyle: React.CSSProperties = {
Expand Down