import{s as ut,n as pt,o as rt}from"../chunks/scheduler.d6170356.js";import{S as ct,i as dt,g as i,s as n,r as u,A as ft,h as o,f as a,c as s,j as mt,u as p,x as m,k as Re,y as ht,a as l,v as r,d as c,t as d,w as f}from"../chunks/index.fcd4cc08.js";import{C as O}from"../chunks/CodeBlock.7b16bdef.js";import{H as K,E as gt}from"../chunks/EditOnGithub.da2b595c.js";function bt(Se){let h,ee,q,te,T,ae,y,je='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/ollama/cover.png" alt="cover"/>',le,M,Ne="🆕 You can now also run private GGUFs from the Hugging Face Hub.",ne,w,We='Ollama is an application based on llama.cpp to interact with LLMs directly through your computer. You can use any GGUF quants created by the community (<a href="https://huggingface.co/bartowski" rel="nofollow">bartowski</a>, <a href="https://huggingface.co/MaziyarPanahi" rel="nofollow">MaziyarPanahi</a> and <a href="https://huggingface.co/models?pipeline_tag=text-generation&amp;library=gguf&amp;sort=trending" rel="nofollow">many more</a>) on Hugging Face directly with Ollama, without creating a new <code>Modelfile</code>. At the time of writing there are 45K public GGUF checkpoints on the Hub, you can run any of them with a single <code>ollama run</code> command. We also provide customisations like choosing quantization type, system prompt and more to improve your overall experience.',se,U,Qe="Getting started is as simple as:",ie,J,Be='<li>Enable <code>ollama</code> under your <a href="https://huggingface.co/settings/local-apps" rel="nofollow">Local Apps settings</a>.</li> <li>On a model page, choose <code>ollama</code> from <code>Use this model</code> dropdown. For example: <a href="https://huggingface.co/bartowski/Llama-3.2-1B-Instruct-GGUF" rel="nofollow">bartowski/Llama-3.2-1B-Instruct-GGUF</a>.</li>',oe,g,Ee='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/ollama-modelpage-light.gif"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/ollama-modelpage-dark.gif"/>',me,G,Pe="The snippet would be in format:",ue,v,pe,$,Ve="Please note that you can use both <code>hf.co</code> and <code>huggingface.co</code> as the domain name.",re,C,Ze="Here are some models you can try:",ce,x,de,H,fe,L,Xe="By default, the <code>Q4_K_M</code> quantization scheme is used, when it’s present inside the model repo. If not, we default to picking one reasonable quant type present inside the repo.",he,k,De="To select a different scheme, simply:",ge,Y,qe="<li>From <code>Files and versions</code> tab on a model page, open GGUF viewer on a particular GGUF file.</li> <li>Choose <code>ollama</code> from <code>Use this model</code> dropdown.</li>",be,b,Ae='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/ollama-modeltree-light.gif"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/ollama-modeltree-dark.gif"/>',Te,F,Oe="The snippet would be in format (quantization tag added):",ye,I,Me,_,Ke="For example:",we,z,Ue,R,Je,S,et="By default, a template will be selected automatically from a list of commonly used templates. It will be selected based on the built-in <code>tokenizer.chat_template</code> metadata stored inside the GGUF file.",Ge,j,tt="If your GGUF file doesn’t have a built-in template or if you want to customize your chat template, you can create a new file called <code>template</code> in the repository. The template must be a Go template, not a Jinja template. Here’s an example:",ve,N,$e,W,at='To know more about the Go template format, please refer to <a href="https://github.com/ollama/ollama/blob/main/docs/template.md" rel="nofollow">this documentation</a>',Ce,Q,lt="You can optionally configure a system prompt by putting it into a new file named <code>system</code> in the repository.",xe,B,nt='To change sampling parameters, create a file named <code>params</code> in the repository. The file must be in JSON format. For the list of all available parameters, please refer to <a href="https://github.com/ollama/ollama/blob/main/docs/modelfile.md#parameter" rel="nofollow">this documentation</a>.',He,E,Le,P,st="You can run private GGUFs from your personal account or from an associated organisation account in two simple steps:",ke,V,it='<li>Copy your Ollama SSH key, you can do so via: <code>cat ~/.ollama/id_ed25519.pub | pbcopy</code></li> <li>Add the corresponding key to your Hugging Face account by going to <a href="https://huggingface.co/settings/keys" rel="nofollow">your account settings</a> and clicking on <code>Add new SSH key</code>.</li> <li>That’s it! You can now run private GGUFs from the Hugging Face Hub: <code>ollama run hf.co/{username}/{repository}</code>.</li>',Ye,Z,Fe,X,ot='<li><a href="https://github.com/ollama/ollama/blob/main/docs/README.md" rel="nofollow">https://github.com/ollama/ollama/blob/main/docs/README.md</a></li> <li><a href="https://huggingface.co/docs/hub/en/gguf" rel="nofollow">https://huggingface.co/docs/hub/en/gguf</a></li>',Ie,D,_e,A,ze;return T=new K({props:{title:"Use Ollama with any GGUF Model on Hugging Face Hub",local:"use-ollama-with-any-gguf-model-on-hugging-face-hub",headingTag:"h1"}}),v=new O({props:{code:"b2xsYW1hJTIwcnVuJTIwaGYuY28lMkYlN0J1c2VybmFtZSU3RCUyRiU3QnJlcG9zaXRvcnklN0Q=",highlighted:"ollama run hf.co/{username}/{repository}",wrap:!1}}),x=new O({props:{code:"b2xsYW1hJTIwcnVuJTIwaGYuY28lMkZiYXJ0b3dza2klMkZMbGFtYS0zLjItMUItSW5zdHJ1Y3QtR0dVRiUwQW9sbGFtYSUyMHJ1biUyMGhmLmNvJTJGbWxhYm9ubmUlMkZNZXRhLUxsYW1hLTMuMS04Qi1JbnN0cnVjdC1hYmxpdGVyYXRlZC1HR1VGJTBBb2xsYW1hJTIwcnVuJTIwaGYuY28lMkZhcmNlZS1haSUyRlN1cGVyTm92YS1NZWRpdXMtR0dVRiUwQW9sbGFtYSUyMHJ1biUyMGhmLmNvJTJGYmFydG93c2tpJTJGSHVtYW5pc2gtTExhbWEzLThCLUluc3RydWN0LUdHVUY=",highlighted:`ollama run hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF
ollama run hf.co/mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated-GGUF
ollama run hf.co/arcee-ai/SuperNova-Medius-GGUF
ollama run hf.co/bartowski/Humanish-LLama3-8B-Instruct-GGUF`,wrap:!1}}),H=new K({props:{title:"Custom Quantization",local:"custom-quantization",headingTag:"h2"}}),I=new O({props:{code:"b2xsYW1hJTIwcnVuJTIwaGYuY28lMkYlN0J1c2VybmFtZSU3RCUyRiU3QnJlcG9zaXRvcnklN0QlM0ElN0JxdWFudGl6YXRpb24lN0Q=",highlighted:"ollama run hf.co/{username}/{repository}:{quantization}",wrap:!1}}),z=new O({props:{code:"b2xsYW1hJTIwcnVuJTIwaGYuY28lMkZiYXJ0b3dza2klMkZMbGFtYS0zLjItM0ItSW5zdHJ1Y3QtR0dVRiUzQUlRM19NJTBBb2xsYW1hJTIwcnVuJTIwaGYuY28lMkZiYXJ0b3dza2klMkZMbGFtYS0zLjItM0ItSW5zdHJ1Y3QtR0dVRiUzQVE4XzAlMEElMEElMjMlMjB0aGUlMjBxdWFudGl6YXRpb24lMjBuYW1lJTIwaXMlMjBjYXNlLWluc2Vuc2l0aXZlJTJDJTIwdGhpcyUyMHdpbGwlMjBhbHNvJTIwd29yayUwQW9sbGFtYSUyMHJ1biUyMGhmLmNvJTJGYmFydG93c2tpJTJGTGxhbWEtMy4yLTNCLUluc3RydWN0LUdHVUYlM0FpcTNfbSUwQSUwQSUyMyUyMHlvdSUyMGNhbiUyMGFsc28lMjBkaXJlY3RseSUyMHVzZSUyMHRoZSUyMGZ1bGwlMjBmaWxlbmFtZSUyMGFzJTIwYSUyMHRhZyUwQW9sbGFtYSUyMHJ1biUyMGhmLmNvJTJGYmFydG93c2tpJTJGTGxhbWEtMy4yLTNCLUluc3RydWN0LUdHVUYlM0FMbGFtYS0zLjItM0ItSW5zdHJ1Y3QtSVEzX00uZ2d1Zg==",highlighted:`ollama run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:IQ3_M
ollama run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0

<span class="hljs-comment"># the quantization name is case-insensitive, this will also work</span>
ollama run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:iq3_m

<span class="hljs-comment"># you can also directly use the full filename as a tag</span>
ollama run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:Llama-3.2-3B-Instruct-IQ3_M.gguf`,wrap:!1}}),R=new K({props:{title:"Custom Chat Template and Parameters",local:"custom-chat-template-and-parameters",headingTag:"h2"}}),N=new O({props:{code:"JTdCJTdCJTIwaWYlMjAuU3lzdGVtJTIwJTdEJTdEJTNDJTdDc3lzdGVtJTdDJTNFJTBBJTdCJTdCJTIwLlN5c3RlbSUyMCU3RCU3RCUzQyU3Q2VuZCU3QyUzRSUwQSU3QiU3QiUyMGVuZCUyMCU3RCU3RCU3QiU3QiUyMGlmJTIwLlByb21wdCUyMCU3RCU3RCUzQyU3Q3VzZXIlN0MlM0UlMEElN0IlN0IlMjAuUHJvbXB0JTIwJTdEJTdEJTNDJTdDZW5kJTdDJTNFJTBBJTdCJTdCJTIwZW5kJTIwJTdEJTdEJTNDJTdDYXNzaXN0YW50JTdDJTNFJTBBJTdCJTdCJTIwLlJlc3BvbnNlJTIwJTdEJTdEJTNDJTdDZW5kJTdDJTNF",highlighted:`<span class="hljs-template-variable">{{ <span class="hljs-name"><span class="hljs-built_in">if</span></span> .System }}</span><span class="language-xml">&lt;|system|&gt;
</span><span class="hljs-template-variable">{{ <span class="hljs-name">.System</span> }}</span><span class="language-xml">&lt;|end|&gt;
</span><span class="hljs-template-variable">{{ <span class="hljs-name">end</span> }}</span><span class="hljs-template-variable">{{ <span class="hljs-name"><span class="hljs-built_in">if</span></span> .Prompt }}</span><span class="language-xml">&lt;|user|&gt;
</span><span class="hljs-template-variable">{{ <span class="hljs-name">.Prompt</span> }}</span><span class="language-xml">&lt;|end|&gt;
</span><span class="hljs-template-variable">{{ <span class="hljs-name">end</span> }}</span><span class="language-xml">&lt;|assistant|&gt;
</span><span class="hljs-template-variable">{{ <span class="hljs-name">.Response</span> }}</span><span class="language-xml">&lt;|end|&gt;</span>`,wrap:!1}}),E=new K({props:{title:"Run Private GGUFs from the Hugging Face Hub",local:"run-private-ggufs-from-the-hugging-face-hub",headingTag:"h2"}}),Z=new K({props:{title:"References",local:"references",headingTag:"h2"}}),D=new gt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/ollama.md"}}),{c(){h=i("meta"),ee=n(),q=i("p"),te=n(),u(T.$$.fragment),ae=n(),y=i("p"),y.innerHTML=je,le=n(),M=i("p"),M.textContent=Ne,ne=n(),w=i("p"),w.innerHTML=We,se=n(),U=i("p"),U.textContent=Qe,ie=n(),J=i("ol"),J.innerHTML=Be,oe=n(),g=i("div"),g.innerHTML=Ee,me=n(),G=i("p"),G.textContent=Pe,ue=n(),u(v.$$.fragment),pe=n(),$=i("p"),$.innerHTML=Ve,re=n(),C=i("p"),C.textContent=Ze,ce=n(),u(x.$$.fragment),de=n(),u(H.$$.fragment),fe=n(),L=i("p"),L.innerHTML=Xe,he=n(),k=i("p"),k.textContent=De,ge=n(),Y=i("ol"),Y.innerHTML=qe,be=n(),b=i("div"),b.innerHTML=Ae,Te=n(),F=i("p"),F.textContent=Oe,ye=n(),u(I.$$.fragment),Me=n(),_=i("p"),_.textContent=Ke,we=n(),u(z.$$.fragment),Ue=n(),u(R.$$.fragment),Je=n(),S=i("p"),S.innerHTML=et,Ge=n(),j=i("p"),j.innerHTML=tt,ve=n(),u(N.$$.fragment),$e=n(),W=i("p"),W.innerHTML=at,Ce=n(),Q=i("p"),Q.innerHTML=lt,xe=n(),B=i("p"),B.innerHTML=nt,He=n(),u(E.$$.fragment),Le=n(),P=i("p"),P.textContent=st,ke=n(),V=i("ol"),V.innerHTML=it,Ye=n(),u(Z.$$.fragment),Fe=n(),X=i("ul"),X.innerHTML=ot,Ie=n(),u(D.$$.fragment),_e=n(),A=i("p"),this.h()},l(e){const t=ft("svelte-u9bgzb",document.head);h=o(t,"META",{name:!0,content:!0}),t.forEach(a),ee=s(e),q=o(e,"P",{}),mt(q).forEach(a),te=s(e),p(T.$$.fragment,e),ae=s(e),y=o(e,"P",{"data-svelte-h":!0}),m(y)!=="svelte-uq8wg8"&&(y.innerHTML=je),le=s(e),M=o(e,"P",{"data-svelte-h":!0}),m(M)!=="svelte-m67op5"&&(M.textContent=Ne),ne=s(e),w=o(e,"P",{"data-svelte-h":!0}),m(w)!=="svelte-1fs6k75"&&(w.innerHTML=We),se=s(e),U=o(e,"P",{"data-svelte-h":!0}),m(U)!=="svelte-5j9tqx"&&(U.textContent=Qe),ie=s(e),J=o(e,"OL",{"data-svelte-h":!0}),m(J)!=="svelte-1wsf0o"&&(J.innerHTML=Be),oe=s(e),g=o(e,"DIV",{class:!0,"data-svelte-h":!0}),m(g)!=="svelte-zg167e"&&(g.innerHTML=Ee),me=s(e),G=o(e,"P",{"data-svelte-h":!0}),m(G)!=="svelte-1dlrr6c"&&(G.textContent=Pe),ue=s(e),p(v.$$.fragment,e),pe=s(e),$=o(e,"P",{"data-svelte-h":!0}),m($)!=="svelte-1jlraez"&&($.innerHTML=Ve),re=s(e),C=o(e,"P",{"data-svelte-h":!0}),m(C)!=="svelte-1o1v4yg"&&(C.textContent=Ze),ce=s(e),p(x.$$.fragment,e),de=s(e),p(H.$$.fragment,e),fe=s(e),L=o(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-pwfktm"&&(L.innerHTML=Xe),he=s(e),k=o(e,"P",{"data-svelte-h":!0}),m(k)!=="svelte-n6qmi0"&&(k.textContent=De),ge=s(e),Y=o(e,"OL",{"data-svelte-h":!0}),m(Y)!=="svelte-l4l582"&&(Y.innerHTML=qe),be=s(e),b=o(e,"DIV",{class:!0,"data-svelte-h":!0}),m(b)!=="svelte-j5uowc"&&(b.innerHTML=Ae),Te=s(e),F=o(e,"P",{"data-svelte-h":!0}),m(F)!=="svelte-11u3b66"&&(F.textContent=Oe),ye=s(e),p(I.$$.fragment,e),Me=s(e),_=o(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-1gkqha7"&&(_.textContent=Ke),we=s(e),p(z.$$.fragment,e),Ue=s(e),p(R.$$.fragment,e),Je=s(e),S=o(e,"P",{"data-svelte-h":!0}),m(S)!=="svelte-64zxxh"&&(S.innerHTML=et),Ge=s(e),j=o(e,"P",{"data-svelte-h":!0}),m(j)!=="svelte-qrpgwz"&&(j.innerHTML=tt),ve=s(e),p(N.$$.fragment,e),$e=s(e),W=o(e,"P",{"data-svelte-h":!0}),m(W)!=="svelte-9z8rs3"&&(W.innerHTML=at),Ce=s(e),Q=o(e,"P",{"data-svelte-h":!0}),m(Q)!=="svelte-tyv6tj"&&(Q.innerHTML=lt),xe=s(e),B=o(e,"P",{"data-svelte-h":!0}),m(B)!=="svelte-3kdvz5"&&(B.innerHTML=nt),He=s(e),p(E.$$.fragment,e),Le=s(e),P=o(e,"P",{"data-svelte-h":!0}),m(P)!=="svelte-pb5nza"&&(P.textContent=st),ke=s(e),V=o(e,"OL",{"data-svelte-h":!0}),m(V)!=="svelte-5tm9ho"&&(V.innerHTML=it),Ye=s(e),p(Z.$$.fragment,e),Fe=s(e),X=o(e,"UL",{"data-svelte-h":!0}),m(X)!=="svelte-x2smhk"&&(X.innerHTML=ot),Ie=s(e),p(D.$$.fragment,e),_e=s(e),A=o(e,"P",{}),mt(A).forEach(a),this.h()},h(){Re(h,"name","hf:doc:metadata"),Re(h,"content",Tt),Re(g,"class","flex justify-center"),Re(b,"class","flex justify-center")},m(e,t){ht(document.head,h),l(e,ee,t),l(e,q,t),l(e,te,t),r(T,e,t),l(e,ae,t),l(e,y,t),l(e,le,t),l(e,M,t),l(e,ne,t),l(e,w,t),l(e,se,t),l(e,U,t),l(e,ie,t),l(e,J,t),l(e,oe,t),l(e,g,t),l(e,me,t),l(e,G,t),l(e,ue,t),r(v,e,t),l(e,pe,t),l(e,$,t),l(e,re,t),l(e,C,t),l(e,ce,t),r(x,e,t),l(e,de,t),r(H,e,t),l(e,fe,t),l(e,L,t),l(e,he,t),l(e,k,t),l(e,ge,t),l(e,Y,t),l(e,be,t),l(e,b,t),l(e,Te,t),l(e,F,t),l(e,ye,t),r(I,e,t),l(e,Me,t),l(e,_,t),l(e,we,t),r(z,e,t),l(e,Ue,t),r(R,e,t),l(e,Je,t),l(e,S,t),l(e,Ge,t),l(e,j,t),l(e,ve,t),r(N,e,t),l(e,$e,t),l(e,W,t),l(e,Ce,t),l(e,Q,t),l(e,xe,t),l(e,B,t),l(e,He,t),r(E,e,t),l(e,Le,t),l(e,P,t),l(e,ke,t),l(e,V,t),l(e,Ye,t),r(Z,e,t),l(e,Fe,t),l(e,X,t),l(e,Ie,t),r(D,e,t),l(e,_e,t),l(e,A,t),ze=!0},p:pt,i(e){ze||(c(T.$$.fragment,e),c(v.$$.fragment,e),c(x.$$.fragment,e),c(H.$$.fragment,e),c(I.$$.fragment,e),c(z.$$.fragment,e),c(R.$$.fragment,e),c(N.$$.fragment,e),c(E.$$.fragment,e),c(Z.$$.fragment,e),c(D.$$.fragment,e),ze=!0)},o(e){d(T.$$.fragment,e),d(v.$$.fragment,e),d(x.$$.fragment,e),d(H.$$.fragment,e),d(I.$$.fragment,e),d(z.$$.fragment,e),d(R.$$.fragment,e),d(N.$$.fragment,e),d(E.$$.fragment,e),d(Z.$$.fragment,e),d(D.$$.fragment,e),ze=!1},d(e){e&&(a(ee),a(q),a(te),a(ae),a(y),a(le),a(M),a(ne),a(w),a(se),a(U),a(ie),a(J),a(oe),a(g),a(me),a(G),a(ue),a(pe),a($),a(re),a(C),a(ce),a(de),a(fe),a(L),a(he),a(k),a(ge),a(Y),a(be),a(b),a(Te),a(F),a(ye),a(Me),a(_),a(we),a(Ue),a(Je),a(S),a(Ge),a(j),a(ve),a($e),a(W),a(Ce),a(Q),a(xe),a(B),a(He),a(Le),a(P),a(ke),a(V),a(Ye),a(Fe),a(X),a(Ie),a(_e),a(A)),a(h),f(T,e),f(v,e),f(x,e),f(H,e),f(I,e),f(z,e),f(R,e),f(N,e),f(E,e),f(Z,e),f(D,e)}}}const Tt='{"title":"Use Ollama with any GGUF Model on Hugging Face Hub","local":"use-ollama-with-any-gguf-model-on-hugging-face-hub","sections":[{"title":"Custom Quantization","local":"custom-quantization","sections":[],"depth":2},{"title":"Custom Chat Template and Parameters","local":"custom-chat-template-and-parameters","sections":[],"depth":2},{"title":"Run Private GGUFs from the Hugging Face Hub","local":"run-private-ggufs-from-the-hugging-face-hub","sections":[],"depth":2},{"title":"References","local":"references","sections":[],"depth":2}],"depth":1}';function yt(Se){return rt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gt extends ct{constructor(h){super(),dt(this,h,yt,bt,ut,{})}}export{Gt as component};
