earendil-works/pi · error
Server URL must use http or https
Error message
Server URL must use http or https
What it means
Error "Server URL must use http or https" thrown in earendil-works/pi.
Source
Thrown at packages/coding-agent/src/extensions/llama/client.ts:144
};
}
export function formatBytes(bytes: number): string {
if (bytes < 1024) return `${bytes} B`;
const units = ["KiB", "MiB", "GiB", "TiB"];
let value = bytes / 1024;
let unit = units[0]!;
for (let index = 1; index < units.length && value >= 1024; index++) {
value /= 1024;
unit = units[index]!;
}
return `${value >= 10 ? value.toFixed(1) : value.toFixed(2)} ${unit}`;
}
export function normalizeLlamaServerUrl(value: string): string {
const url = new URL(value.trim());
if (url.protocol !== "http:" && url.protocol !== "https:") {
throw new Error("Server URL must use http or https");
}
url.hash = "";
url.search = "";
url.pathname = url.pathname.replace(/\/+$/u, "").replace(/\/v1$/u, "") || "/";
return url.toString().replace(/\/$/u, "");
}
export function llamaInferenceUrl(serverUrl: string): string {
return `${normalizeLlamaServerUrl(serverUrl)}/v1`;
}
export class LlamaClient {
readonly serverUrl: string;
private readonly apiKey: string | undefined;
constructor(serverUrl: string, apiKey?: string) {
this.serverUrl = normalizeLlamaServerUrl(serverUrl);
this.apiKey = apiKey;View on GitHub (pinned to 4af9d21d3b)
When it happens
Trigger: Thrown at packages/coding-agent/src/extensions/llama/client.ts:144 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/a540431826a34781.
Report an issue: GitHub.