remove call to npm causing noticible delay when starting chat

This commit is contained in:
Dax Raad
2025-06-18 10:35:41 -04:00
parent 5110fbdaf9
commit ae4d089c06
2 changed files with 1 additions and 29 deletions

View File

@@ -43,9 +43,7 @@ export namespace Provider {
for (const model of Object.values(provider.models)) {
model.cost = {
input: 0,
inputCached: 0,
output: 0,
outputCached: 0,
}
}
return {
@@ -234,7 +232,7 @@ export namespace Provider {
const s = await state()
const existing = s.sdk.get(provider.id)
if (existing) return existing
const [pkg, version] = await ModelsDev.pkg(provider.npm ?? provider.id)
const [pkg, version] = provider.npm ?? provider.id
const mod = await import(await BunProc.install(pkg, version))
const fn = mod[Object.keys(mod).find((key) => key.startsWith("create"))!]
const loaded = fn(s.providers[provider.id]?.options)