An interactive Python REPL interface for running Deepseek's language models locally, featuring 4-bit quantization for efficient memory usage.

python3 -m venv venv
source venv/bin/activate
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install transformers accelerate colorama bitsandbytes
python3 model_setup.py
python3 repl.py
Exit using:
model_setup.py: Downloads and caches the model locallyrepl.py: Main REPL interface with interactive promptmain.py: Alternative implementation with direct model loadingrun.py: Simple script for testing model responsesDeepseek> Write a function to calculate fibonacci
Response: Here's a function to calculate Fibonacci numbers:
def fibonacci(n):
if n <= 0:
return 0
elif n == 1:
return 1
else:
a, b = 0, 1
for _ in range(2, n + 1):
a, b = b, a + b
return b
Deepseek> 2 + 2
Response: 4
The implementation uses 4-bit quantization via the BitsAndBytesConfig to reduce VRAM usage while maintaining model performance. This allows the model to run on GPUs with 8GB VRAM, though 16GB is recommended for optimal performance.
MIT
10 commits
Python
92.4%
C++
7.2%
An interactive Python REPL interface for running Deepseek's language models locally, featuring 4-bit quantization for efficient memory usage.

python3 -m venv venv
source venv/bin/activate
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install transformers accelerate colorama bitsandbytes
python3 model_setup.py
python3 repl.py
Exit using:
model_setup.py: Downloads and caches the model locallyrepl.py: Main REPL interface with interactive promptmain.py: Alternative implementation with direct model loadingrun.py: Simple script for testing model responsesDeepseek> Write a function to calculate fibonacci
Response: Here's a function to calculate Fibonacci numbers:
def fibonacci(n):
if n <= 0:
return 0
elif n == 1:
return 1
else:
a, b = 0, 1
for _ in range(2, n + 1):
a, b = b, a + b
return b
Deepseek> 2 + 2
Response: 4
The implementation uses 4-bit quantization via the BitsAndBytesConfig to reduce VRAM usage while maintaining model performance. This allows the model to run on GPUs with 8GB VRAM, though 16GB is recommended for optimal performance.
MIT
10 commits
Python
92.4%
C++
7.2%