Skip to content

jjdubski/DeepChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

DeepChat

Python Docker Ollama

DeepChat is a small Python CLI that launches an Ollama-backed chat session. It supports two runtime modes:

  • Local mode: uses the Ollama server installed on your machine.
  • Container mode: starts the official ollama/ollama Docker image and talks to it over http://localhost:11434.

On startup, the script prepares the selected runtime, pulls the requested model, runs a quick test prompt, and then drops into an interactive prompt loop.

Requirements

  • Python 3
  • Internet access for the first model pull
  • For local mode: Ollama installed and available on your PATH
  • For container mode: Docker installed and running

Usage

python main.py [model] [--local|-l]
  • model is optional. If omitted, the script uses deepseek-r1:1.5b.
  • --local or -l is optional.
  • If no flag is provided, the script uses Docker mode.

Modes

Local mode

python main.py deepseek-r1:7b --local
python main.py deepseek-r1:7b -l

Local mode:

  • upgrades pip
  • installs the Python ollama package if needed
  • starts ollama serve
  • pulls the requested model locally
  • opens an interactive chat session through the Python Ollama client

Docker mode

python main.py deepseek-coder-v2

Docker mode:

  • installs the Python requests package if needed
  • stops and removes any existing container named ollama
  • starts a fresh ollama/ollama container
  • pulls the requested model inside the container
  • opens an interactive chat session through the Ollama HTTP API

Examples

# Use the default model in Docker mode
python main.py

# Run a local Ollama model
python main.py deepseek-r1:7b --local

# Run a model in Docker mode
python main.py deepseek-coder-v2

Large Context Inputs

If you want to paste larger prompts or code blocks, you may need a model variant with a higher context window. This repository includes a modelfile that sets:

  • num_ctx 24576
  • num_predict 8192

Create a patched model like this:

ollama pull deepseek-coder-v2
ollama create deepseek-coder-v2-patch -f modelfile
python main.py deepseek-coder-v2-patch --local

You can replace deepseek-coder-v2 with any compatible base model.

Notes

  • The script rejects unknown flags and exits if too many arguments are provided.
  • In Docker mode, the container is always named ollama.
  • The interactive output strips <think>...</think> content before printing visible answers.

Screenshot

DeepChat screenshot

About

A CLI tool for interacting with DeepSeek model.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages