janhq/jan · error · Error
Failed to parse archive name: ${archiveName}. Expected forma
Error message
Failed to parse archive name: ${archiveName}. Expected format: [Optional prefix-]llama-<version>-bin-<backend>.(tar.gz|zip) What it means
After confirming the archive path is valid, the archive's basename is tested against a regex that expects the naming convention [prefix-]llama-<version>-bin-<backend>.(tar.gz|zip). If the regex does not match, the extension cannot determine the version and backend identifier from the filename.
Source
Thrown at extensions/llamacpp-extension/src/index.ts:2865
// - llama-b7037-bin-win-cuda-12.4-x64.zip (legacy format)
const re =
/^(.+?[-_])?llama(?:-main)?-(b\d+(?:-[a-f0-9]+)?)(?:-cudart-llama)?-bin-(.+?)\.(?:tar\.gz|zip)$/
const archiveName = await basename(path)
logger.info(`Installing backend from path: ${path}`)
if (
!(await fs.existsSync(path)) ||
(!path.endsWith('tar.gz') && !path.endsWith('zip'))
) {
logger.error(`Invalid path or file ${path}`)
throw new Error(`Invalid path or file ${path}`)
}
const match = re.exec(archiveName)
if (!match) {
throw new Error(
`Failed to parse archive name: ${archiveName}. Expected format: [Optional prefix-]llama-<version>-bin-<backend>.(tar.gz|zip)`
)
}
const [, prefix, version, backend] = match
if (!version || !backend) {
throw new Error(`Invalid backend archive name: ${archiveName}`)
}
// Include prefix in the backend identifier if present
const backendIdentifier = prefix ? `${prefix}${backend}` : backend
logger.info(
`Detected prefix: ${prefix || 'none'}, version: ${version}, backend: ${backendIdentifier}`
)
const backendDir = await getBackendDir(backendIdentifier, version)View on GitHub (pinned to fad3f12a14)
Solutions
- Use an archive from the official llama.cpp / Jan release that follows the expected naming convention.
- If using a custom build, rename the archive to match: [prefix-]llama-<version>-bin-<backend>.zip or .tar.gz.
- If the upstream convention changed, update the regex in the source to match the new pattern.
Example fix
// before (filename: my-custom-build.zip) // after (rename to: llama-b1234-bin-win-cuda-12.4-x64.zip)
Defensive patterns
Strategy: validation
Validate before calling
const BACKEND_ARCHIVE_RE = /^(.+?[-_])?llama(?:-main)?-(b\d+(?:-[a-f0-9]+)?)(?:-cudart-llama)?-bin-(.+?)\.(?:tar\.gz|zip)$/
function matchesBackendNaming(archiveName: string): boolean {
return BACKEND_ARCHIVE_RE.test(archiveName)
}
// Before calling install:
if (!matchesBackendNaming(archiveName)) {
throw new Error(`Archive name does not match expected convention: ${archiveName}`)
} Type guard
function isBackendArchiveName(name: string): boolean {
return /^(.+?[-_])?llama(?:-main)?-(b\d+(?:-[a-f0-9]+)?)(?:-cudart-llama)?-bin-(.+?)\.(?:tar\.gz|zip)$/.test(name)
} Prevention
- Download archives only from the official llama.cpp / Jan releases that follow the naming convention.
- When using custom builds, rename the archive to match the expected pattern before installation.
When it happens
Trigger: The archive filename does not follow the llama.cpp release naming convention. Examples: 'mybackend.zip', 'llama-b1234-bin-win-x64.7z' (wrong extension caught earlier but also wrong here), 'custom-build-v2.tar.gz', a renamed upstream file.
Common situations: User downloaded a custom or community build with a different naming scheme; user renamed the archive; the upstream naming convention changed in a new release and this regex was not updated.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Invalid backend archive name: ${archiveName}
- Invalid path or file ${path}
- Not a supported backend archive! Missing llama-server binary
- Invalid backend string: ${targetBackendString} supplied to u
- Invalid backend string format: "${targetBackendString}". Exp
AI-assisted analysis of janhq/jan@fad3f12a14 (2026-08-12).
Data as JSON: /api/errors/a2f634cdc90b3506.
Report an issue: GitHub.