{"id":10847,"date":"2026-11-17T10:59:41","date_gmt":"2026-11-17T01:59:41","guid":{"rendered":"https:\/\/localmodelwatch.tsuchitsuchi.com\/?p=10847"},"modified":"2026-11-17T11:09:06","modified_gmt":"2026-11-17T02:09:06","slug":"ollama-v0-40-2-released","status":"publish","type":"post","link":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/2026\/11\/17\/ollama-v0-40-2-released\/","title":{"rendered":"Ollama v0.40.2 Released: Automatic Model Upgrades &#038; More"},"content":{"rendered":"<p><!-- lmw:facts --><\/p>\n<h2>At a Glance<\/h2>\n<div class=\"lmw-table-scroll\" tabindex=\"0\" style=\"overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;\">\n<table style=\"width:max-content;min-width:100%;border-collapse:collapse;\">\n<thead>\n<tr>\n<th>Item<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Repository<\/td>\n<td><a href=\"https:\/\/github.com\/ollama\/ollama\">ollama\/ollama<\/a><\/td>\n<\/tr>\n<tr>\n<td>Version<\/td>\n<td><a href=\"https:\/\/github.com\/ollama\/ollama\/releases\/tag\/v0.40.2\">v0.40.2<\/a><\/td>\n<\/tr>\n<tr>\n<td>Published<\/td>\n<td>2026-10-09<\/td>\n<\/tr>\n<tr>\n<td>License<\/td>\n<td>MIT<\/td>\n<\/tr>\n<tr>\n<td>Source type<\/td>\n<td>Primary source (the publisher itself)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><em>Values determined by this site&#8217;s code when the information was collected. Dates are JST.<\/em><\/p>\n<p><!-- \/lmw:facts --><\/p>\n<h2>Overview<\/h2>\n<p>The latest version &#8220;v0.40.2&#8221; of &#8220;Ollama&#8221;, a tool that allows users to easily run and manage a variety of large language models locally, has been released. Ollama is an MIT-licensed open-source software developed in Go, characterized by the ability to easily deploy and run inference on various open-weight models such as DeepSeek, Gemma, and Qwen via the command line or API.<\/p>\n<p>The most significant change in v0.40.2 is that when running models downloaded in previous versions, an upgrade is now automatically performed in the background to improve operating performance and compatibility on llama.cpp. Without requiring manual model re-downloading or complex conversion tasks, models are updated to an optimized state transparently upon their first run. For local LLM users who have continuously managed model assets from past versions, this update significantly improves convenience and inference stability.<\/p>\n<h2>Key Changes<\/h2>\n<h3>Automatic Upgrade and Backup of Models Downloaded in Past Versions<\/h3>\n<p>For model assets acquired with older versions of Ollama, automatic upgrade processing is now performed in the background upon the first execution. This process aims to improve performance and compatibility on the inference backend, llama.cpp. Users do not need to explicitly reconvert or re-download models themselves.<\/p>\n<p>Additionally, to ensure safe downgrading to previous versions after updating, Ollama keeps a copy of the old original model on disk as a temporary backup. These backup files are scheduled to be automatically deleted in future releases, but a procedure to manually and immediately delete backups is also provided for users who do not want to consume storage space. To perform manual deletion, run the following shell script (requires the <code>jq<\/code> command):<\/p>\n<pre><code class=\"language-shell\">curl -s localhost:11434\/api\/tags | jq -r '.models[].name' | while read -r m; do\n  curl -s localhost:11434\/api\/show -d &quot;{\\&quot;model\\&quot;:\\&quot;$m\\&quot;}&quot; | jq -r \\\n    'select(any(.manifests[]?;.runner == &quot;llamacpp&quot;)) |.manifests[] | select(.runner == &quot;ggml&quot;) |.digest'\ndone | sort -u | xargs -n1 ollama rm\n<\/code><\/pre>\n<p>This command safely deletes only the backups. However, please note that if you downgrade to a version prior to v0.40 after running this operation, you will need to re-acquire the target model (<code>ollama pull<\/code>).<\/p>\n<h3>Hiding Duplicate Entries in the <code>ollama list<\/code> Command<\/h3>\n<p>Along with automatic model upgrades, an issue where duplicate entries of upgraded models appeared when running the <code>ollama list<\/code> command has been fixed (PR #18874).<\/p>\n<p>In previous internal behavior, when loading older GGUF models, lazy conversion to a llama.cpp-compatible format was performed, and both old and new GGUF files and shadow manifests were retained as protection for downgrading. However, those internal protection manifests also appeared in the list display, causing confusion for users and API consumers. With this fix, unnecessary duplicates and internal management entries are hidden from the user-facing list output, allowing users to cleanly check only currently available models.<\/p>\n<h3>Leveraging Full Context Length in <code>ollama launch claude<\/code><\/h3>\n<p>When using the <code>ollama launch claude<\/code> command, the behavior has been improved so that the model&#8217;s native maximum context length (full context length) is utilized (PR #18855).<\/p>\n<p>Without the context length being unintentionally restricted as before, long prompt inputs and context retention making the maximum use of the model&#8217;s input capacity become possible. Users who previously performed long-text analysis and dialogue using the relevant feature via Ollama can use the expanded context length without making special configuration changes after the update.<\/p>\n<h2>How to Get It<\/h2>\n<p>Since specific installation commands for this release are not included in the provided materials, please check the <a href=\"https:\/\/github.com\/ollama\/ollama\/releases\/tag\/v0.40.2\">GitHub Releases Page<\/a> of the official repository when performing the update, and obtain the latest executable or package suitable for your environment.<\/p>\n<p>Additionally, an operational note regarding before and after updating to Ollama v0.40.2 involves model data storage management. When running existing models after updating to this version, automatic optimization processing for llama.cpp is performed in the background on the first run, improving compatibility and performance. At this time, original older-format model data is retained as backups within the disk to guarantee safe downgrading.<\/p>\n<p>While these backups are scheduled to be automatically cleaned up in future releases, if you want to immediately free up disk space, you can safely delete unnecessary backup files by running the manual deletion script combined with the <code>jq<\/code> command. However, if you downgrade to a version prior to v0.40 after deleting the backups, you will need to re-download the corresponding model (<code>ollama pull<\/code>), so please perform deletions according to your environment&#8217;s migration policy.<\/p>\n<p>After applying the update, we recommend running the <code>ollama list<\/code> command to check the model list and verify that the duplicate display of models subject to upgrading, which occurred in previous environments, has been resolved.<\/p>\n<p><!-- lmw:releases --><\/p>\n<h2>Releases Since Our Last Article<\/h2>\n<p><em>Compiled by Local Model Watch from the project&#8217;s GitHub releases: the versions between this release and the last one we covered, which did not get separate articles.<\/em> <em>Full history: <a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/engine-ollama-en\/\">release tracker<\/a>.<\/em><\/p>\n<div class=\"lmw-table-scroll\" tabindex=\"0\" style=\"overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;\">\n<table style=\"width:max-content;min-width:100%;border-collapse:collapse;\">\n<thead>\n<tr>\n<th>Version<\/th>\n<th>Released<\/th>\n<th>Release notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>v0.40.1<\/td>\n<td>2026-10-08<\/td>\n<td><a href=\"https:\/\/github.com\/ollama\/ollama\/releases\/tag\/v0.40.1\">GitHub<\/a><\/td>\n<\/tr>\n<tr>\n<td>v0.35.1<\/td>\n<td>2026-09-30<\/td>\n<td><a href=\"https:\/\/github.com\/ollama\/ollama\/releases\/tag\/v0.35.1\">GitHub<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><!-- \/lmw:releases --><\/p>\n<p><!-- lmw:related --><\/p>\n<h2>Related Articles<\/h2>\n<ul>\n<li><a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/2026\/11\/17\/ollama-v0-40-4-released\/\">Ollama v0.40.4 Released with Decision Models Support<\/a><\/li>\n<li><a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/2026\/11\/17\/ollama-v0-40-15-released\/\">Ollama v0.40.15 Released with Parallel Vision GGUF Support<\/a><\/li>\n<li><a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/2026\/11\/17\/ollama-v04012-released\/\">Ollama v0.40.12 Released: Adds Liquid AI LFM3 and d1 Models<\/a><\/li>\n<li><a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/2026\/11\/17\/ollama-v0-40-9-released-2\/\">Ollama v0.40.9 Released with Apple Silicon Phonon Speech Support<\/a><\/li>\n<\/ul>\n<p><!-- \/lmw:related --><\/p>\n<p><!-- lmw:next-steps --><\/p>\n<h2>What to Read Next<\/h2>\n<ul>\n<li><strong>Follow this tool<\/strong> \u2192 <a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/engine-ollama-en\/\">Ollama overview and release history (200 releases tracked)<\/a><\/li>\n<li><strong>Other inference engines and runtimes<\/strong> \u2192 <a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/engine-llama-cpp-en\/\">llama.cpp<\/a> \/ <a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/engine-vllm-en\/\">vLLM<\/a> \/ <a href=\"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/engine-sglang-en\/\">SGLang<\/a><\/li>\n<\/ul>\n<p><!-- \/lmw:next-steps --><\/p>\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/ollama\/ollama\/releases\/tag\/v0.40.2\">https:\/\/github.com\/ollama\/ollama\/releases\/tag\/v0.40.2<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ollama\/ollama\/pull\/18874\">https:\/\/github.com\/ollama\/ollama\/pull\/18874<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ollama\/ollama\/pull\/18855\">https:\/\/github.com\/ollama\/ollama\/pull\/18855<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ollama\/ollama\/pull\/18739\">https:\/\/github.com\/ollama\/ollama\/pull\/18739<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Ollama v0.40.2 is now available, featuring automatic background model upgrades for llama.cpp, deduplication in ollama list, and full context lengths.<\/p>\n","protected":false},"author":1,"featured_media":10846,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[163,1073,1093,1547],"class_list":["post-10847","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engines-and-tools","tag-gguf-en","tag-llama-cpp-en","tag-ollama-en","tag-verified"],"lang":"en","translations":{"en":10847,"ja":10845},"_links":{"self":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts\/10847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/comments?post=10847"}],"version-history":[{"count":2,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts\/10847\/revisions"}],"predecessor-version":[{"id":17727,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts\/10847\/revisions\/17727"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/media\/10846"}],"wp:attachment":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/media?parent=10847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/categories?post=10847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/tags?post=10847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}