DeepSeek R1 🐋
Overview
This repository contains a powerful coding assistant application that integrates with the DeepSeek API to process user conversations and generate structured JSON responses. Through an intuitive command-line interface, it can read local file contents, create new files, and apply diff edits to existing files in real time.
Key Features
-
DeepSeek Client Configuration
- Automatically configures an API client to use the DeepSeek service with a valid DEEPSEEK_API_KEY
- Connects to the DeepSeek endpoint specified in the environment variable to stream GPT-like completions
-
Data Models
- Leverages Pydantic for type-safe handling of file operations:
- FileToCreate: Defines structure for new files to be created
- FileToEdit: Specifies changes to be made to existing files
- AssistantResponse: Structures chat responses and file operations
- Leverages Pydantic for type-safe handling of file operations:
-
System Prompt
- Implements a comprehensive system prompt that guides conversation flow
- Ensures all responses follow strict JSON formatting
- Supports both file creation and editing operations
-
File Operations
- read_local_file(): Reads and returns file contents as string
- create_file(): Creates or updates files with provided content
- show_diff_table(): Displays proposed changes in a rich format
- apply_diff_edit(): Implements precise file modifications
-
File Integration Commands
- "/add path/to/file": Reads and includes single file content
- "/add path/to/folder": Adds all non-binary, non-hidden files from directory
- Enables context-aware assistance based on your codebase
-
Conversation Management
- Maintains conversation history for context awareness
- Streams responses via DeepSeek API in real-time
- Parses responses as JSON for structured operations
-
Interactive CLI
- Simple command-line interface
- Real-time file modification previews
- Easy confirmation of suggested changes
- Exit with "exit" or "quit" commands
Installation
-
Configure Environment:
# Create .env file with API key echo "DEEPSEEK_API_KEY=your_api_key_here" > .env
-
Install & Run:
Using pip:
pip install -r requirements.txt python3 src/deepseek_r1/main.py
Using uv (recommended for speed):
uv venv uv run src/deepseek_r1/main.py
Advanced Features: Reasoning Model
The src/deepseek_r1/r1.py script provides enhanced capabilities using DeepSeek's Reasoning Model:
- Chain of Thought (CoT) reasoning visualization
- Transparent decision-making process
- Full compatibility with base features
- Dedicated reasoning display panel
- Clean conversation history
Usage:
python3 src/deepseek_r1/r1.py
Metadata
Release files for deepseek-r1 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deepseek_r1-0.1.1.tar.gz | 11.5 kB | Without provenance | Details for deepseek_r1-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deepseek_r1-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for deepseek_r1-0.1.1-py3-none-any.whl |
Total release size: 22.8 kB
Release files / deepseek_r1-0.1.1.tar.gz
| Download URL | deepseek_r1-0.1.1.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5cc93aceb8b11bf7e6032fce3afbb71decb5e8d39d5d44a309693099b195abc
|
|
BLAKE2b-256 checksum How to use checksums |
2af0eb9402d500c33f78db6a3893da6449ebfd0230206bb574aa459176965ccf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / deepseek_r1-0.1.1-py3-none-any.whl
| Download URL | deepseek_r1-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0dd7434f26ea9bf4fc9726a5d1b3ed3ad630d53c46d73e608ada4860225715a5
|
|
BLAKE2b-256 checksum How to use checksums |
1924c0986dc9a9baf20867250c6d7afba57adf217a5b2c66c83a0256aac11951
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for deepseek-r1 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.