How to Integrate Ollama with Codex App for 100% Free Local AI Coding

Sovary June 17, 2026 12
3 minutes read

For a long time, accessing the best AI coding tools meant being trapped in a cycle of monthly subscription fees and the necessity of sending your private code to cloud servers. However, the landscape has changed with the integration of local models into OpenAI’s Codex app via Ollama. Codex is not just a plugin or an autocomplete tool; it is a standalone AI coding agent that can receive tasks, write plans, execute steps, and return completed code. By plugging Ollama a lightweight engine for running local AI directly into Codex, you can now use powerful open-source models like Gemma 4, DeepSeek, or Qwen entirely on your own machine. The benefits are clear:

  • 100% Free: No more subscriptions or hidden costs
  • Data Privacy: Your code stays on your computer and never touches the cloud
  • Offline Capability: Models can respond instantly without an active internet connection
  • Performance: You leverage your own computer's power to run top-tier coding models

Step 1: Install the Codex App

The first step is to download the Codex app, which is currently available for Windows and macOS. Visit the official website and download the installer file, which is approximately 500 MB. Run the installer on your machine to complete the setup

Step 2: Install and Update Ollama

Next, you need to set up Ollama, the engine that will host your local models.

  1. Go to ollama.com and choose your preferred installation method: either a terminal command for PowerShell or a dedicated desktop installer (~200 MB for Windows).
  2. Crucial Requirement: Ensure you have version 0.24 or higher installed. Previous versions (like 0.23.2) will result in errors during the integration process.

Step 3: Verify Your Hardware Compatibility

Local AI requires significant system resources. Before downloading a model, use a tool like canirun.ai to see what your hardware can handle.

  • Enter your specific specs, such as your GPU and VRAM (e.g., an Nvidia 3070 Ti with 8GB VRAM).
  • The site will provide a list of models that will perform well on your system. For example, Gemma 4 is a popular choice that requires about 9.6 GB of space.

Step 4: Download Your Local AI Model

Once you know which model fits your hardware, you need to pull it into Ollama.

  1. Navigate to the models menu on the Ollama website and search for a model like Gemma 4.
  2. Copy the specific run command from the model's detail page.
  3. Open your command prompt (CMD), ensure Ollama is running in the background, and paste the command to begin the download.

Step 5: Connect Ollama to the Codex App

With the model downloaded, you must now link the two applications.

  1. Open a new CMD window and run the integration command found in the Codex documentation.
ollama launch codex-app
  1. If your software is updated correctly, you will see a list of models. Use your arrow keys to select your local model (e.g., Gemma 4 E4B) and hit enter.
  2. The Codex app will officially activate using that model.

Step 6: Configure and Launch

On the first launch of the integrated app:

  1. Complete the initial setup by clicking "who you are" and hitting continue.
  2. You will be asked if you want to import work from other AI apps; you can choose to do this or skip it.
  3. Once finished, the Codex app will load with your local model running entirely through Ollama.

Step 7: Start Coding Locally

You are now ready to use premium AI coding capabilities for free. You can give Codex instructions, such as "build a clean landing page from scratch".

  • Monitor Resources: During the "thinking" phase, you will notice your GPU and RAM usage increase as the hardware works to generate the code.
  • Final Result: Once generated, you can copy the code, save it (e.g., as an HTML file), and view your locally-created project.
LLM  Ollama  AI Agent 
Author

As the founder and passionate educator behind this platform, I’m dedicated to sharing practical knowledge in programming to help you grow. Whether you’re a beginner exploring Machine Learning, PHP, Laravel, Python, Java, or Android Development, you’ll find tutorials here that are simple, accessible, and easy to understand. My mission is to make learning enjoyable and effective for everyone. Dive in, start learning, and don’t forget to follow along for more tips and insights!. Follow him