How to Run Deepseek R1 Locally with Ollama and Test APIs Using Apidog

Learn how to run Deepseek R1 locally with Ollama for secure, flexible AI reasoning, and test your APIs efficiently using Apidog. This guide is tailored for developers integrating advanced LLMs into their API workflows.

Ashley Innocent

Ashley Innocent

20 January 2026

How to Run Deepseek R1 Locally with Ollama and Test APIs Using Apidog

Are you looking to leverage the power of Deepseek R1, an advanced reasoning large language model, directly on your machine? Running Deepseek R1 locally not only enhances data privacy and reduces latency, but also gives you full control over AI-driven workflows—especially when integrating with your API stack. In this guide, you'll learn how to set up Deepseek R1 using Ollama and test its API endpoints efficiently with Apidog. Whether you’re an API developer, backend engineer, or technical lead, this walkthrough is tailored for hands-on professionals building with AI.

button

What is Deepseek R1?

Deepseek R1 is a highly capable open-source reasoning model developed by DeepSeek AI, designed to excel at tasks such as mathematical problem-solving, code generation, and logical reasoning. Unlike cloud-based LLM APIs, running Deepseek R1 locally gives you:

Ollama is a lightweight tool that makes deploying and managing local language models like Deepseek R1 fast and developer-friendly.

Learn more: DeepSeek R1: The Best Open-Source Reasoning LLM Challenging OpenAI’s o1What is DeepSeek R1 and Why Should You Care?


Prerequisites: What You Need Before You Start

Before installing Deepseek R1, ensure you have:


Step 1: Install and Verify Ollama

Ollama simplifies running large AI models locally. Here’s how to set it up:

  1. Download Ollama

    • Visit the Ollama website and get the appropriate installer for your operating system.

    Image

  2. Install Ollama

    • Follow the on-screen installation instructions.
  3. Verify Installation

    • Open your terminal and run:
      ollama --version
      
    • You should see the installed version number, confirming a successful setup.

    Image


Step 2: Download and Run Deepseek R1 with Ollama

Download the Model

To pull the Deepseek R1 model (8 billion parameters) onto your machine, run:

ollama run deepseek-r1

Ollama will handle the download and first-time setup. This may take a few minutes depending on your internet speed.

Image

Verify Model Installation

Check that the model is available by running:

ollama list

Look for deepseek-r1:8b in the output. If present, installation is successful.

Image

Start a Deepseek R1 Session

To interact with Deepseek R1, simply run:

ollama run deepseek-r1

You now have a live AI reasoning model ready to process your questions or data—locally.


Step 3: Interact with Deepseek R1 Locally

Once Deepseek R1 is running, you’ll see a prompt where you can enter queries. Example prompts:

Get creative—Deepseek R1 is capable of a wide range of reasoning tasks.

Image


Advanced: Integrating Deepseek R1 with Python Projects

To embed Deepseek R1 into your Python applications, use Ollama’s Python bindings:

import ollama

response = ollama.chat(model='deepseek-r1', messages=[
    {
        'role': 'user',
        'content': 'Explain the concept of recursion in programming.',
    },
])

print(response['message']['content'])

This approach lets you build AI-powered features, automate code generation, or power backend services—securely on your own hardware.


Troubleshooting Common Issues

Encountering problems? Here are some quick solutions:

The Ollama community is active and helpful if you need more support.


Step 4: Test and Document Deepseek R1 APIs with Apidog

Once Deepseek R1 is running locally, you may want to expose it as an API for integration with your services or apps. Apidog is a unified platform for API development, testing, and documentation—ideal for validating your Deepseek R1 endpoints.

button

💡 Apidog streamlines every stage of your API lifecycle. Try it with DeepSeek API today!

How to Test Your Deepseek R1 API in Apidog

  1. Create a New Project

    • Open Apidog, click “New Project,” and give it a descriptive name.

  2. Add Your API Endpoint

    • Click “New request” to add an API endpoint.
    • Enter the API URL exposed by your Deepseek R1 instance.
    • Specify the HTTP method (usually POST) and include any necessary headers or authentication info.

    Image
    0
    1

  3. Define the Request Body

    • Switch to the “Body” tab.
    • Select the appropriate format (e.g., JSON) and input the parameters needed by your Deepseek R1 API.

    2

  4. Send and Validate the Request

    • Click “Send” to make the API call.
    • Review the response status, headers, and body. Apidog provides easy validation tools to compare responses against expected outputs.

    3

If you receive a valid response with Deepseek R1’s output, your local API integration is working as intended.


Conclusion: Empower Your AI and API Workflow

Deploying Deepseek R1 locally with Ollama gives you a robust, private AI reasoning engine at your fingertips. By integrating with tools like Apidog, you can efficiently develop, test, and document new API-powered features—accelerating your team’s AI development lifecycle.

button

Explore more

How To Turn Claude Code into a Video Director with Remotion

How To Turn Claude Code into a Video Director with Remotion

Remotion Agent Skills let you create professional videos using Claude Code and natural language. Learn how to install with npx skills add remotion-dev/skills.

23 January 2026

How to use Claude Code Skills for Documentation

How to use Claude Code Skills for Documentation

Learn to review and improve technical documentation with Claude Code. Covers completeness checks, API docs, consistency validation, and CI/CD integration.

22 January 2026

How to use Claude Code Skills for Testing?

How to use Claude Code Skills for Testing?

Learn E2E testing, AI debugging, Playwright automation, and TDD strategies with Claude Code for reliable web app releases in 2026.

22 January 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs