<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Randika prasad</title>
    <description>The latest articles on DEV Community by Randika prasad (@prasadrandika).</description>
    <link>https://dev.to/prasadrandika</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4251884%2Fa86c1d97-5162-4472-b88a-70944bc9cc4f.png</url>
      <title>DEV Community: Randika prasad</title>
      <link>https://dev.to/prasadrandika</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prasadrandika"/>
    <language>en</language>
    <item>
      <title>GPT-4o shuts down on Jan 14, 2027: what breaks when you switch to gpt-6-luna</title>
      <dc:creator>Randika prasad</dc:creator>
      <pubDate>Wed, 18 Nov 2026 12:32:41 +0000</pubDate>
      <link>https://dev.to/prasadrandika/gpt-4o-shuts-down-on-jan-14-2027-what-breaks-when-you-switch-to-gpt-6-luna-59kg</link>
      <guid>https://dev.to/prasadrandika/gpt-4o-shuts-down-on-jan-14-2027-what-breaks-when-you-switch-to-gpt-6-luna-59kg</guid>
      <description>&lt;p&gt;OpenAI is shutting down &lt;strong&gt;GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini&lt;/strong&gt; in the API on &lt;strong&gt;January 14, 2027&lt;/strong&gt;. OpenAI's &lt;a href="https://developers.openai.com/api/docs/deprecations" rel="noopener noreferrer"&gt;deprecations page&lt;/a&gt; lists &lt;strong&gt;gpt-6-luna&lt;/strong&gt; as the recommended replacement.&lt;/p&gt;

&lt;p&gt;Most guides say "just change the model name". I migrated 5 open-source projects this week, and in some of them, changing only the model name would have broken the app. Here's what I found.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. tiktoken crashes on the new model name
&lt;/h2&gt;

&lt;p&gt;If your app counts tokens (for example, to split long text into chunks), you might have this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;enc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tiktoken&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encoding_for_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"gpt-4o-mini"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change it to &lt;code&gt;gpt-6-luna&lt;/code&gt; and it raises &lt;code&gt;KeyError&lt;/code&gt;. I tested tiktoken &lt;strong&gt;0.7.0 and 0.14.0&lt;/strong&gt;, and neither knows the new name, so upgrading doesn't help.&lt;/p&gt;

&lt;p&gt;A safe fix is to fall back to &lt;code&gt;o200k_base&lt;/code&gt;, the encoding the old models used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;tiktoken&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_encoding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tiktoken&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encoding_for_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;KeyError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tiktoken&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_encoding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"o200k_base"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your chunk sizes stay the same, and once tiktoken learns the new name, the code uses it automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Tool calls on Chat Completions need &lt;code&gt;reasoning_effort: "none"&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;gpt-6-luna is a reasoning model. According to its &lt;a href="https://developers.openai.com/api/docs/models/gpt-6-luna" rel="noopener noreferrer"&gt;model page&lt;/a&gt;, Chat Completions supports function calling &lt;strong&gt;only with &lt;code&gt;reasoning_effort&lt;/code&gt; set to &lt;code&gt;none&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So if your agent does this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"gpt-6-luna"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;your tool calls can fail. Add &lt;code&gt;reasoning_effort="none"&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"gpt-6-luna"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reasoning_effort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"none"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On older versions of the openai Python library, you can pass it with &lt;code&gt;extra_body={"reasoning_effort": "none"}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In one project, four agents sent tools with no &lt;code&gt;reasoning_effort&lt;/code&gt;. A plain model swap would have broken every tool call.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Bare model names point to dated snapshots
&lt;/h2&gt;

&lt;p&gt;The deprecations page lists dated snapshots like &lt;code&gt;gpt-4o-mini-2024-07-18&lt;/code&gt;. If your code uses the bare name &lt;code&gt;gpt-4o-mini&lt;/code&gt;, it points to those snapshots, so it's affected too. Search for both.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Look beyond the obvious file
&lt;/h2&gt;

&lt;p&gt;GitHub code search only shows the first match per repo. In one project, search showed 1 file, but the full repo had old model defaults in a router, Go agents, Rust agents, Python agents, config and docs. Search the whole repo, and check &lt;code&gt;.env&lt;/code&gt; and config files too.&lt;/p&gt;

&lt;h2&gt;
  
  
  A tool to find these for you
&lt;/h2&gt;

&lt;p&gt;I turned these checks into a small open-source CLI, &lt;strong&gt;&lt;a href="https://github.com/prasadrandika/luna-check" rel="noopener noreferrer"&gt;luna-check&lt;/a&gt;&lt;/strong&gt;. It scans Python, JS/TS and Go, and reports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;retiring model IDs, with the shutdown date and replacement&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tiktoken.encoding_for_model()&lt;/code&gt; calls that will crash&lt;/li&gt;
&lt;li&gt;function tools sent on Chat Completions without &lt;code&gt;reasoning_effort: "none"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every rule links to its source. It skips comments, tests and price tables to keep false positives low, and it's tested on the before/after code of 5 real migrations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install git+https://github.com/prasadrandika/luna-check@v0.1.0
luna-check .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's also a GitHub Action, so you can run it in CI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limits:&lt;/strong&gt; it can't see model names that only come from environment variables or config, and I haven't tested it against the real API.&lt;/p&gt;

&lt;p&gt;If you find a false positive or a case it misses, please open an issue. And if you'd like help migrating before January 14, feel free to reach out on &lt;a href="https://github.com/prasadrandika" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I used AI assistance (Claude Code) for the migrations and the tool, and reviewed the results myself.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>llm</category>
      <category>openai</category>
      <category>python</category>
    </item>
  </channel>
</rss>
