1const A=32768,f=4e3;function s(n={}){var a;const e=[n.launch_context_length,n.launchContextLength,n.launchContext,n.contextWindow,n.context_length,n.context_length_tokens,n.max_context_length,n.maxContextLength,(a=n==null?void 0:n.meta)==null?void 0:a.n_ctx_train,n==null?void 0:n.n_ctx_train];for(const t of e){const o=Number(t);if(Number.isFinite(o)&&o>0&&o!==262144&&o!==128e3)return Math.max(1024,Math.min(Math.floor(o),32768))}return 32768}function p(n=""){const e=String(n||"").trim();if(!e)return"";if(/^ollama\//i.test(e))return e;const a=e.replace(/^(local-llamacpp|llamacpp)\//i,"").replace(/\s*\(llama\.cpp\)\s*$/i,"").trim();return a?`local-llamacpp/${a}`:""}function _(n=""){return p(n).replace(/^local-llamacpp\//i,"")}function C(n,e=n,a={}){const t=s(a),o=_(n||e);return{id:o,name:o||e||n,contextWindow:t}}const u=new Set(["local-helper-ack","trooper-fine-llm","qwen2.5-0.5b-helper","qwen2.5-1.5b-helper","gemma-4-e4b","gemma-4-26b-a4b","gemma-4-31b","qwen-3.5-4b","qwen-3.5-9b","qwen-3.5-35b","glm-4.7-flash-30b","nemotron-3-nano-4b","nemotron-3-nano-30b"]);function b(n=[]){const e=new Map,a=[];for(const t of n||[]){if(!t||typeof t!="object")continue;const o=String(t.id||"").trim();if(!o)continue;const g=o.replace(/^(local-llamacpp|llamacpp)\//i,"").replace(/\s*\(llama\.cpp\)\s*$/i,"").trim();if(!(t.provider==="local-llamacpp"||t.category==="local"||/^(local-llamacpp|llamacpp)\//i.test(o)||/\(llama\.cpp\)/i.test(String(t.name||""))||u.has(g)||Array.isArray(t.tags)&&t.tags.some(m=>/llama\.?cpp|local/i.test(String(m))))||/^ollama\//i.test(o)){e.has(o)?e.set(o,{...e.get(o),...t}):(e.set(o,{...t}),a.push(o));continue}const r=p(o),c=r,l=e.get(c)||{},i=s({...l,...t,launch_context_length:t.launch_context_length||t.launchContextLength||l.launch_context_length||l.launchContextLength,contextWindow:t.contextWindow??t.context_length??l.contextWindow??l.context_length}),L=_(r),h={...l,...t,id:r,name:L,provider:"local-llamacpp",routingProvider:"local-llamacpp",category:"local",context_length:i,contextWindow:i,launch_context_length:i,tags:Array.from(new Set([...Array.isArray(l.tags)?l.tags:[],...Array.isArray(t.tags)?t.tags:[],"local","llama.cpp"]))};e.has(c)||a.push(c),e.set(c,h)}return a.map(t=>e.get(t)).filter(Boolean)}export{A as LOCAL_LLAMA_LAUNCH_CONTEXT_CAP,f as LOCAL_LLAMA_RESERVE_TOKENS_FLOOR,_ as bareLocalLlamaModelName,C as buildLocalLlamaModelContextEntry,b as mergeLocalModelCatalogEntries,p as normalizeLocalLlamaCatalogId,s as resolveLocalLlamaContextWindow};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.