Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Using Open Source Models","local":"using-open-source-models","sections":[{"title":"Let’s try some models!","local":"lets-try-some-models","sections":[],"depth":2},{"title":"Building with open source models","local":"building-with-open-source-models","sections":[],"depth":2},{"title":"Widgets - Quick Model Testing","local":"widgets---quick-model-testing","sections":[],"depth":2},{"title":"The Playground - Advanced Experimentation","local":"the-playground---advanced-experimentation","sections":[],"depth":2},{"title":"API Calls - Build Real Applications","local":"api-calls---build-real-applications","sections":[],"depth":2},{"title":"How to Use Local Apps","local":"how-to-use-local-apps","sections":[],"depth":2},{"title":"Supported Local Apps","local":"supported-local-apps","sections":[{"title":"Llama.cpp","local":"llamacpp","sections":[],"depth":3},{"title":"Ollama","local":"ollama","sections":[],"depth":3},{"title":"Jan","local":"jan","sections":[],"depth":3},{"title":"LM Studio","local":"lm-studio","sections":[],"depth":3}],"depth":2},{"title":"Your Next Challenge","local":"your-next-challenge","sections":[],"depth":2}],"depth":1}"> | |
| <link href="/docs/101-course/pr_4/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/entry/start.b6742992.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/scheduler.1d51f4c0.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/singletons.023d1c68.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/index.fa8592cf.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/paths.daa2f795.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/entry/app.8b986792.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/index.fda43871.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/nodes/0.b5fb3b56.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/each.e59479a4.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/nodes/5.0cd93bc9.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/Tip.e808fe4c.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/CodeBlock.16130beb.js"> | |
| <link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/getInferenceSnippets.58a43ad0.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"Using Open Source Models","local":"using-open-source-models","sections":[{"title":"Let’s try some models!","local":"lets-try-some-models","sections":[],"depth":2},{"title":"Building with open source models","local":"building-with-open-source-models","sections":[],"depth":2},{"title":"Widgets - Quick Model Testing","local":"widgets---quick-model-testing","sections":[],"depth":2},{"title":"The Playground - Advanced Experimentation","local":"the-playground---advanced-experimentation","sections":[],"depth":2},{"title":"API Calls - Build Real Applications","local":"api-calls---build-real-applications","sections":[],"depth":2},{"title":"How to Use Local Apps","local":"how-to-use-local-apps","sections":[],"depth":2},{"title":"Supported Local Apps","local":"supported-local-apps","sections":[{"title":"Llama.cpp","local":"llamacpp","sections":[],"depth":3},{"title":"Ollama","local":"ollama","sections":[],"depth":3},{"title":"Jan","local":"jan","sections":[],"depth":3},{"title":"LM Studio","local":"lm-studio","sections":[],"depth":3}],"depth":2},{"title":"Your Next Challenge","local":"your-next-challenge","sections":[],"depth":2}],"depth":1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="using-open-source-models" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#using-open-source-models"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Using Open Source Models</span></h1> <p data-svelte-h="svelte-bas8f9">Ready to try some AI models? The Hugging Face Hub hosts many open-source models you can use right now — no setup required.</p> <p data-svelte-h="svelte-zgumw9">What makes this special? You get access to the same models that power many AI applications, completely free. Whether you’re a curious beginner or an experienced developer, you can experiment with text generation, image creation, translation, and more.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-1hxabkt">New to AI models? Think of them as specialized tools: some write text, some create images, some translate.</p></div> <h2 class="relative group"><a id="lets-try-some-models" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#lets-try-some-models"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Let’s try some models!</span></h2> <p data-svelte-h="svelte-1xvlltc">Let’s try a text model (e.g., <code>openai/gpt-oss-120b</code>) in the Hugging Face Playground:</p> <iframe src="https://huggingface.co/spaces/huggingface/text-generation-inference" frameborder="0" width="850" height="450"></iframe> <p data-svelte-h="svelte-nasiwc">Now try an image editing Space: <a href="https://huggingface.co/spaces/Qwen/Qwen-Image-Edit" rel="nofollow">Qwen Image Edit</a>.</p> <iframe src="https://qwen-qwen-image-edit.hf.space" frameborder="0" width="850" height="450"></iframe> <p data-svelte-h="svelte-aec770">For audio, try a text-to-speech model.</p> <iframe src="https://nihalgazi-text-to-speech-unlimited.hf.space" frameborder="0" width="850" height="450"></iframe> <h2 class="relative group"><a id="building-with-open-source-models" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#building-with-open-source-models"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Building with open source models</span></h2> <p data-svelte-h="svelte-mza7ot">Beyond trying models, you can build your own tools and applications using several approaches, each with different levels of complexity and control.</p> <p data-svelte-h="svelte-4siqys"><strong>Widgets</strong> allow you to try models directly in their model cards. This gives you a quick overview of what the model can do without any setup or account requirements.</p> <p data-svelte-h="svelte-vj0ds5"><strong>The Playground</strong> lets you try models directly on the website with advanced controls and parameter tuning. No coding is required, but you get more customization options.</p> <p data-svelte-h="svelte-22oisz"><strong>API Calls</strong> enable you to integrate models via simple HTTP requests into your own applications and services.</p> <p data-svelte-h="svelte-1vuvp51"><strong>Python Libraries</strong> let you download and run models locally for full control over the execution environment.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-knzzts">Start simple! Most people begin with browser widgets to understand what models can do, then move to APIs or Python as their projects grow more complex.</p></div> <h2 class="relative group"><a id="widgets---quick-model-testing" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#widgets---quick-model-testing"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Widgets - Quick Model Testing</span></h2> <p data-svelte-h="svelte-ennc0l">Every model on the Hub has an interactive widget that lets you test it instantly. No account needed, no setup - just type and see what happens!</p> <p data-svelte-h="svelte-1rlm515">To use widgets effectively, visit any model page such as <a href="https://huggingface.co/openai/gpt-oss-120b" rel="nofollow"><code>openai/gpt-oss-120b</code></a>. Look for the widget on the right side of the screen, which provides an immediate way to interact with the model. Start by trying the example inputs first to understand the expected format, then experiment with your own inputs to see how the model responds.</p> <p data-svelte-h="svelte-1sd4b9o">Different types of models offer different interaction possibilities. Text models let you type prompts for stories, questions, or creative writing, as demonstrated by models like <a href="https://huggingface.co/openai/gpt-oss-120b" rel="nofollow"><code>openai/gpt-oss-120b</code></a>. Image models allow you to describe what you want to see and generate custom images. Text-to-speech models convert your written text into audio output, such as the <a href="https://huggingface.co/hexgrad/Kokoro-82M" rel="nofollow">Kokoro</a> model.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-ksftwe">Widget not working? Some models are popular and may be busy. Try again in a few minutes, or look for similar models that aren’t as crowded.</p></div> <h2 class="relative group"><a id="the-playground---advanced-experimentation" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#the-playground---advanced-experimentation"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>The Playground - Advanced Experimentation</span></h2> <p data-svelte-h="svelte-3sllxx">The Playground offers more sophisticated controls and settings that help you understand and compare models in depth.</p> <p data-svelte-h="svelte-1ia068o">What makes Playgrounds particularly valuable is their advanced parameter controls. You can adjust temperature to control randomness, modify length limits, and experiment with other settings that affect model behavior. The ability to compare multiple models side by side helps you understand which approach works best for your specific use case. You can save and share successful experiments, building a library of configurations that work well for different tasks. Provider selection allows you to route requests through different inference providers based on your needs for speed, cost, or specific capabilities.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-1dcxl1j">Pro Tips:</p> <ul data-svelte-h="svelte-1xxi7md"><li>Start with default settings, then experiment with one parameter at a time</li> <li>Save combinations that work well for future use</li> <li>Try the same prompt with different models to see how they compare</li></ul></div> <h2 class="relative group"><a id="api-calls---build-real-applications" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#api-calls---build-real-applications"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>API Calls - Build Real Applications</span></h2> <p data-svelte-h="svelte-u3a9mn">Ready to integrate AI into your application? APIs let you add AI capabilities with just a few lines of code.</p> <p data-svelte-h="svelte-1qlv7yh">The process is straightforward: send a request to the model with your input, receive the AI’s response from the API, and use that response in your application. This simple pattern enables powerful integrations without the complexity of managing models yourself.</p> <p data-svelte-h="svelte-13u120e"><strong>Simple API Example (Python):</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> InferenceClient | |
| client = InferenceClient() | |
| response = client.text_generation( | |
| <span class="hljs-string">"Write a short story about a robot:"</span>, | |
| model=<span class="hljs-string">"microsoft/DialoGPT-large"</span> | |
| ) | |
| <span class="hljs-built_in">print</span>(response)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1ggqwku">APIs provide significant advantages for application development. There’s no setup required since models run on Hugging Face servers, not yours. The infrastructure automatically handles traffic spikes through auto-scaling. You can choose from multiple providers like Hugging Face, Together AI, and others based on your specific needs. Limited free usage is available for experimentation, letting you test before committing to paid plans.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-1iaw4y3">Go deeper: We’re moving pretty fast over these topics, but at the end of this chapter we’ll dive deep into building AI applications with APIs.</p></div> <h2 class="relative group"><a id="how-to-use-local-apps" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#how-to-use-local-apps"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>How to Use Local Apps</span></h2> <p data-svelte-h="svelte-16h0yw1">Local apps are applications that can run Hugging Face models directly on your machine. To get started:</p> <ol data-svelte-h="svelte-o1jadj"><li><strong>Enable local apps</strong> in your <a href="https://huggingface.co/settings/local-apps" rel="nofollow">Local Apps settings</a>.</li></ol> <p data-svelte-h="svelte-152w20"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/local-apps/settings.png" alt="Local Apps"></p> <ol data-svelte-h="svelte-12z2g69"><li><strong>Choose a supported model</strong> from the Hub by searching for it. You can filter by <code>app</code> in the <code>Other</code> section of the navigation bar:</li></ol> <p data-svelte-h="svelte-1xwyyiw"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/local-apps/search_llamacpp.png" alt="Local Apps"></p> <ol start="3" data-svelte-h="svelte-158m3tq"><li><strong>Select the local app</strong> from the “Use this model” dropdown on the model page.</li></ol> <p data-svelte-h="svelte-na1gux"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/local-apps/button.png" alt="Local Apps"></p> <ol start="4" data-svelte-h="svelte-zepibb"><li><strong>Copy and run</strong> the provided command in your terminal.</li></ol> <p data-svelte-h="svelte-uft7ly"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/local-apps/command.png" alt="Local Apps"></p> <h2 class="relative group"><a id="supported-local-apps" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#supported-local-apps"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Supported Local Apps</span></h2> <p data-svelte-h="svelte-j5w8wn">The best way to check if a local app is supported is to go to the Local Apps settings and see if the app is listed. Here is a quick overview of some of the most popular local apps:</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-gm51vt">👨💻 To use these local apps, copy the snippets from the model card as above.</p> <p data-svelte-h="svelte-i4u8xt">👷 If you’re building a local app, you can learn about integrating with the Hub in <a href="https://huggingface.co/docs/hub/en/models-adding-libraries" rel="nofollow">this guide</a>.</p></div> <h3 class="relative group"><a id="llamacpp" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#llamacpp"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Llama.cpp</span></h3> <p data-svelte-h="svelte-wyuacm">Llama.cpp is a high-performance C/C++ library for running LLMs locally with optimized inference across lots of different hardware, including CPUs, CUDA and Metal.</p> <p data-svelte-h="svelte-j74s2p"><strong>Advantages:</strong></p> <ul data-svelte-h="svelte-popivm"><li>Extremely fast performance for CPU-based models on multiple CPU families</li> <li>Low resource usage</li> <li>Multiple interface options (CLI, server, Python library)</li> <li>Hardware-optimized for CPUs and GPUs</li></ul> <p data-svelte-h="svelte-pgi06i">To use Llama.cpp, navigate to the model card and click “Use this model” and copy the command.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-comment"># Load and run the model:</span> | |
| ./llama-server -hf unsloth/gpt-oss-20b-GGUF:Q4_K_M<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="ollama" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#ollama"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Ollama</span></h3> <p data-svelte-h="svelte-ak987m">Ollama is an application that lets you run large language models locally on your computer with a simple command-line interface.</p> <p data-svelte-h="svelte-j74s2p"><strong>Advantages:</strong></p> <ul data-svelte-h="svelte-1wkz0eu"><li>Easy installation and setup</li> <li>Direct integration with Hugging Face Hub</li></ul> <p data-svelte-h="svelte-1ww97mi">To use Ollama, navigate to the model card and click “Use this model” and copy the command.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->ollama run hf.co/unsloth/gpt-oss-20b-GGUF:Q4_K_M<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="jan" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#jan"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Jan</span></h3> <p data-svelte-h="svelte-1f0wlel">Jan is an open-source ChatGPT alternative that runs entirely offline with a user-friendly interface.</p> <p data-svelte-h="svelte-j74s2p"><strong>Advantages:</strong></p> <ul data-svelte-h="svelte-1wffgn5"><li>User-friendly GUI</li> <li>Chat with documents and files</li> <li>OpenAI-compatible API server, so you can run models and use them from other apps</li></ul> <p data-svelte-h="svelte-hn2w3l">To use Jan, navigate to the model card and click “Use this model”. Jan will open and you can start chatting through the interface.</p> <h3 class="relative group"><a id="lm-studio" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#lm-studio"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>LM Studio</span></h3> <p data-svelte-h="svelte-o6lyhs">LM Studio is a desktop application that provides an easy way to download, run, and experiment with local LLMs.</p> <p data-svelte-h="svelte-j74s2p"><strong>Advantages:</strong></p> <ul data-svelte-h="svelte-pnflos"><li>Intuitive graphical interface</li> <li>Built-in model browser</li> <li>Developer tools and APIs</li> <li>Free for personal and commercial use</li></ul> <p data-svelte-h="svelte-1qmex3u">Navigate to the model card and click “Use this model”. LM Studio will open and you can start chatting through the interface.</p> <h2 class="relative group"><a id="your-next-challenge" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#your-next-challenge"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Your Next Challenge</span></h2> <p data-svelte-h="svelte-1h7idel">Ready to put this knowledge into practice? Pick one approach and try it this week:</p> <p data-svelte-h="svelte-70e4uh">Widget Explorer: Try 5 different models using their widgets to understand the variety of capabilities available.</p> <p data-svelte-h="svelte-13e8usq">API Builder: Make your first API call and integrate it into a simple application to see how easy it is to add AI features.</p> <p data-svelte-h="svelte-9wi60m">Local Runner: Download a model and run it locally with Python to experience the full control that local execution provides.</p> <p data-svelte-h="svelte-ym6y1z">Playground Pro: Experiment with parameters in different playgrounds to understand how model settings affect output quality.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-1vftcpm">Start small! Pick the approach that matches your current skill level. You can always progress to more advanced methods later.</p></div> <p data-svelte-h="svelte-moctdp">The world of open-source AI is waiting for you to explore, experiment, and create. Every expert started as a beginner - your journey starts with trying your first model!</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/101-course/blob/main/chapters/en/chapter1/3.mdx" target="_blank"><span data-svelte-h="svelte-1kd6by1"><</span> <span data-svelte-h="svelte-x0xyl0">></span> <span data-svelte-h="svelte-1dajgef"><span class="underline ml-1.5">Update</span> on GitHub</span></a> <p></p> | |
| <script> | |
| { | |
| __sveltekit_kib1ob = { | |
| assets: "/docs/101-course/pr_4/en", | |
| base: "/docs/101-course/pr_4/en", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/101-course/pr_4/en/_app/immutable/entry/start.b6742992.js"), | |
| import("/docs/101-course/pr_4/en/_app/immutable/entry/app.8b986792.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 5], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 38 kB
- Xet hash:
- 1c5f6cf49a9d93ec0b8fc4637f24e3a573e1f0c288fe4f79a9f34f5be2c68b06
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.