Merge branch 'dev' into feat/file-attachment
This commit is contained in:
commit
fa8b3664cb
@ -41,7 +41,7 @@ Jan is an open-source replacement for ChatGPT:
|
||||
|
||||
Jan is a full [product suite](https://en.wikipedia.org/wiki/Software_suite) that offers an alternative to Big AI:
|
||||
- [Jan Desktop](/docs/desktop/quickstart): macOS, Windows, and Linux apps with offline mode
|
||||
- [Jan Web](https://chat.jan.ai): Jan on browser, a direct alternative to chatgpt.com
|
||||
- [Jan Web](https://chat.menlo.ai): Jan on browser, a direct alternative to chatgpt.com
|
||||
- Jan Mobile: iOS and Android apps (Coming Soon)
|
||||
- [Jan Server](/docs/server): deploy locally, in your cloud, or on-prem
|
||||
- [Jan Models](/docs/models): Open-source models optimized for deep research, tool use, and reasoning
|
||||
|
||||
@ -156,8 +156,13 @@ export async function listSupportedBackends(): Promise<
|
||||
supportedBackends.push('macos-arm64')
|
||||
}
|
||||
// get latest backends from Github
|
||||
const remoteBackendVersions =
|
||||
let remoteBackendVersions = []
|
||||
try {
|
||||
remoteBackendVersions =
|
||||
await fetchRemoteSupportedBackends(supportedBackends)
|
||||
} catch (e) {
|
||||
console.debug(`Not able to get remote backends, Jan might be offline or network problem: ${String(e)}`)
|
||||
}
|
||||
|
||||
// Get locally installed versions
|
||||
const localBackendVersions = await getLocalInstalledBackends()
|
||||
|
||||
@ -2035,6 +2035,69 @@ export default class llamacpp_extension extends AIEngine {
|
||||
libraryPath,
|
||||
envs,
|
||||
})
|
||||
// On Linux with AMD GPUs, llama.cpp via Vulkan may report UMA (shared) memory as device-local.
|
||||
// For clearer UX, override with dedicated VRAM from the hardware plugin when available.
|
||||
try {
|
||||
const sysInfo = await getSystemInfo()
|
||||
if (sysInfo?.os_type === 'linux' && Array.isArray(sysInfo.gpus)) {
|
||||
const usage = await getSystemUsage()
|
||||
if (usage && Array.isArray(usage.gpus)) {
|
||||
const uuidToUsage: Record<string, { total_memory: number; used_memory: number }> = {}
|
||||
for (const u of usage.gpus as any[]) {
|
||||
if (u && typeof u.uuid === 'string') {
|
||||
uuidToUsage[u.uuid] = u
|
||||
}
|
||||
}
|
||||
|
||||
const indexToAmdUuid = new Map<number, string>()
|
||||
for (const gpu of sysInfo.gpus as any[]) {
|
||||
const vendorStr =
|
||||
typeof gpu?.vendor === 'string'
|
||||
? gpu.vendor
|
||||
: typeof gpu?.vendor === 'object' && gpu.vendor !== null
|
||||
? String(gpu.vendor)
|
||||
: ''
|
||||
if (
|
||||
vendorStr.toUpperCase().includes('AMD') &&
|
||||
gpu?.vulkan_info &&
|
||||
typeof gpu.vulkan_info.index === 'number' &&
|
||||
typeof gpu.uuid === 'string'
|
||||
) {
|
||||
indexToAmdUuid.set(gpu.vulkan_info.index, gpu.uuid)
|
||||
}
|
||||
}
|
||||
|
||||
if (indexToAmdUuid.size > 0) {
|
||||
const adjusted = dList.map((dev) => {
|
||||
if (dev.id?.startsWith('Vulkan')) {
|
||||
const match = /^Vulkan(\d+)/.exec(dev.id)
|
||||
if (match) {
|
||||
const vIdx = Number(match[1])
|
||||
const uuid = indexToAmdUuid.get(vIdx)
|
||||
if (uuid) {
|
||||
const u = uuidToUsage[uuid]
|
||||
if (
|
||||
u &&
|
||||
typeof u.total_memory === 'number' &&
|
||||
typeof u.used_memory === 'number'
|
||||
) {
|
||||
const total = Math.max(0, Math.floor(u.total_memory))
|
||||
const free = Math.max(0, Math.floor(u.total_memory - u.used_memory))
|
||||
return { ...dev, mem: total, free }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return dev
|
||||
})
|
||||
return adjusted
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
logger.warn('Device memory override (AMD/Linux) failed:', e)
|
||||
}
|
||||
|
||||
return dList
|
||||
} catch (error) {
|
||||
logger.error('Failed to query devices:\n', error)
|
||||
|
||||
@ -103,7 +103,6 @@ const ChatInput = ({
|
||||
const selectedModel = useModelProvider((state) => state.selectedModel)
|
||||
const selectedProvider = useModelProvider((state) => state.selectedProvider)
|
||||
const sendMessage = useChat()
|
||||
const { productAnalytic } = useAnalytic()
|
||||
const [message, setMessage] = useState('')
|
||||
const [dropdownToolsAvailable, setDropdownToolsAvailable] = useState(false)
|
||||
const [tooltipToolsAvailable, setTooltipToolsAvailable] = useState(false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user