thinking
This commit is contained in:
@@ -75,7 +75,7 @@ export async function syncLocalProvidersToPiConfig(): Promise<void> {
|
||||
models: models.map(m => ({
|
||||
id: m.id,
|
||||
name: m.name || m.id,
|
||||
reasoning: false,
|
||||
reasoning: isReasoningModel(m.id),
|
||||
input: ['text'],
|
||||
contextWindow: m.contextWindow || 128000,
|
||||
maxTokens: m.maxTokens || 4096,
|
||||
@@ -94,6 +94,20 @@ export async function syncLocalProvidersToPiConfig(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
/** Detect reasoning-capable models by name patterns */
|
||||
const REASONING_PATTERNS = [
|
||||
/\bqwen3\b/i,
|
||||
/\bqwq\b/i,
|
||||
/\bdeepseek-r1\b/i,
|
||||
/\br1\b/i,
|
||||
/\breasoning\b/i,
|
||||
/\bthink/i,
|
||||
];
|
||||
|
||||
function isReasoningModel(modelId: string): boolean {
|
||||
return REASONING_PATTERNS.some(p => p.test(modelId));
|
||||
}
|
||||
|
||||
async function fetchModelsFromLocalProvider(
|
||||
lp: LocalProvider,
|
||||
): Promise<{ id: string; name?: string; contextWindow?: number; maxTokens?: number }[]> {
|
||||
|
||||
Reference in New Issue
Block a user