feat(commands): multi-select ordered command pipeline with step reordering and single-pass composition (AI-05, AI-07)
This commit is contained in:
parent
f49acf0105
commit
10af20a0ad
157 changed files with 29455 additions and 913 deletions
27
apps/desktop/tests/main/utils/inference-cpu-budget.test.ts
Normal file
27
apps/desktop/tests/main/utils/inference-cpu-budget.test.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
import { inferenceCpuThreads, localInferenceCpuOptions } from '../../../src/main/utils/inference-cpu-budget'
|
||||
|
||||
describe('local inference scheduling budget', () => {
|
||||
it.each([[1, 1], [2, 1], [3, 1], [4, 2], [6, 4], [8, 4], [16, 4], [64, 4]])(
|
||||
'leaves foreground headroom on %i available CPUs (%i workers)', (cpus, expected) => {
|
||||
expect(inferenceCpuThreads(cpus)).toBe(expected)
|
||||
}
|
||||
)
|
||||
|
||||
it.each([0, -1, Number.NaN, Number.POSITIVE_INFINITY])('uses one worker for invalid capacity %s', (cpus) => {
|
||||
expect(inferenceCpuThreads(cpus)).toBe(1)
|
||||
})
|
||||
|
||||
it.each(['http://localhost:11434', 'http://localhost.:11434', 'http://127.0.0.1:11434', 'http://127.0.0.2:11434', 'http://[::1]:11434'])(
|
||||
'bounds the local engine at %s', (url) => {
|
||||
expect(localInferenceCpuOptions(url).num_thread).toBeGreaterThanOrEqual(1)
|
||||
expect(localInferenceCpuOptions(url).num_thread).toBeLessThanOrEqual(4)
|
||||
}
|
||||
)
|
||||
|
||||
it.each(['https://llm.example.com', 'http://192.168.1.2:11434', 'http://localhost.example.com', 'invalid'])(
|
||||
'does not infer a remote engine budget from this PC: %s', (url) => {
|
||||
expect(localInferenceCpuOptions(url)).toEqual({})
|
||||
}
|
||||
)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue