<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Huggingface-Cli on KnightLi Blog</title>
        <link>https://www.knightli.com/en/tags/huggingface-cli/</link>
        <description>Recent content in Huggingface-Cli on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Fri, 17 Apr 2026 14:48:04 +0800</lastBuildDate><atom:link href="https://www.knightli.com/en/tags/huggingface-cli/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Where Does huggingface-cli download Save Models by Default</title>
        <link>https://www.knightli.com/en/2026/04/17/huggingface-cli-download-default-cache-path/</link>
        <pubDate>Fri, 17 Apr 2026 14:48:04 +0800</pubDate>
        
        <guid>https://www.knightli.com/en/2026/04/17/huggingface-cli-download-default-cache-path/</guid>
        <description>&lt;p&gt;If you download a model with the Hugging Face command-line tool, for example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;huggingface-cli download &amp;lt;repo-id&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;the downloaded model files usually do not appear in the current directory. Instead, they are saved into Hugging Face&amp;rsquo;s default cache directory.&lt;/p&gt;
&lt;h2 id=&#34;default-cache-locations&#34;&gt;Default cache locations
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;huggingface-cli download&lt;/code&gt; follows the Hugging Face Hub cache mechanism. The default paths are:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;System&lt;/th&gt;
          &lt;th&gt;Default cache directory&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Linux / macOS&lt;/td&gt;
          &lt;td&gt;&lt;code&gt;~/.cache/huggingface/hub&lt;/code&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Windows&lt;/td&gt;
          &lt;td&gt;&lt;code&gt;C:\Users\用户名\.cache\huggingface\hub&lt;/code&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;On Windows, if your username is &lt;code&gt;knightli&lt;/code&gt;, the default path is roughly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;C:\Users\knightli\.cache\huggingface\hub
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;why-the-model-is-not-in-the-current-directory&#34;&gt;Why the model is not in the current directory
&lt;/h2&gt;&lt;p&gt;This is expected behavior. By default, &lt;code&gt;huggingface-cli download&lt;/code&gt; stores repository files in the cache directory so they can be reused later without downloading them again.&lt;/p&gt;
&lt;p&gt;Inside the cache directory, repositories are usually stored in a structure like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;models--组织名--模型名
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;For example, a model repository may be cached as:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;models--unsloth--gemma-4-E4B-it-GGUF
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The actual model files are usually under the &lt;code&gt;snapshots&lt;/code&gt; subdirectory inside that cache folder.&lt;/p&gt;
&lt;h2 id=&#34;how-to-download-to-a-specific-directory&#34;&gt;How to download to a specific directory
&lt;/h2&gt;&lt;p&gt;If you want the model files to appear in a directory you choose, add &lt;code&gt;--local-dir&lt;/code&gt; to &lt;code&gt;huggingface-cli download&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;huggingface-cli download &amp;lt;repo-id&amp;gt; --local-dir D:&lt;span class=&#34;se&#34;&gt;\m&lt;/span&gt;odels&lt;span class=&#34;se&#34;&gt;\&amp;lt;&lt;/span&gt;model-name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This is more convenient when working with local inference tools such as &lt;code&gt;llama.cpp&lt;/code&gt;, &lt;code&gt;Ollama&lt;/code&gt;, or &lt;code&gt;LM Studio&lt;/code&gt;, because the model files are easier to find later.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Default cache directory: &lt;code&gt;~/.cache/huggingface/hub&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Default Windows directory: &lt;code&gt;C:\Users\用户名\.cache\huggingface\hub&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;--local-dir&lt;/code&gt; if you want to save files to a specific location&lt;/li&gt;
&lt;li&gt;If you are only looking for a &lt;code&gt;.gguf&lt;/code&gt; file, first check the &lt;code&gt;snapshots&lt;/code&gt; subdirectory under the corresponding cached model repository&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        
    </channel>
</rss>
