chore(vendor): import pi 1.3.0

Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.

git-subtree-dir: third_party/pi

git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
alexion committed 2026-10-15 17:58:48 -04:00
1 parent 719370c8f7
commit 6081e3e325
1743 files changed
+205459 -131704

No files matched your search

@@ -30,6 +30,7 @@ export interface LlamaModelsResponse {
export interface LlamaServerProps {
models_autoload?: boolean;
chat_template?: string;
}
export interface LlamaModelEvent {
@@ -193,11 +194,15 @@ export class LlamaClient {
return data;
}
async props(options: { signal?: AbortSignal } = {}): Promise<LlamaServerProps> {
const payload = await this.request("/props", { signal: options.signal });
async props(options: { model?: string; signal?: AbortSignal } = {}): Promise<LlamaServerProps> {
const query = options.model ? `?${new URLSearchParams({ model: options.model, autoload: "false" })}` : "";
const payload = await this.request(`/props${query}`, { signal: options.signal });
if (typeof payload !== "object" || payload === null) return {};
const { models_autoload: modelsAutoload } = payload as Record<string, unknown>;
return typeof modelsAutoload === "boolean" ? { models_autoload: modelsAutoload } : {};
const { models_autoload: modelsAutoload, chat_template: chatTemplate } = payload as Record<string, unknown>;
return {
...(typeof modelsAutoload === "boolean" ? { models_autoload: modelsAutoload } : {}),
...(typeof chatTemplate === "string" ? { chat_template: chatTemplate } : {}),
};
}
async load(model: string, signal?: AbortSignal): Promise<void> {