winfunc/deepreasoning
A high-performance LLM inference API and Chat UI that integrates DeepSeek R1's CoT reasoning traces with Anthropic Claude models.
Slowing — last commit 7mo ago
weakest axisno tests detected; no CI workflows detected
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
last commit was 7mo ago; no CI workflows detected
- ✓Last commit 7mo ago
- ✓2 active contributors
- ✓MIT licensed
Show all 8 evidence items →Show less
- ⚠Slowing — last commit 7mo ago
- ⚠Small team — 2 contributors active in recent commits
- ⚠Concentrated ownership — top contributor handles 56% of recent commits
- ⚠No CI workflows detected
- ⚠No test directory detected
What would change the summary?
- →Use as dependency Mixed → Healthy if: add a test suite
- →Deploy as-is Mixed → Healthy if: 1 commit in the last 180 days
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Forkable" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/winfunc/deepreasoning)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/winfunc/deepreasoning on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: winfunc/deepreasoning
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/winfunc/deepreasoning shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Slowing — last commit 7mo ago
- Last commit 7mo ago
- 2 active contributors
- MIT licensed
- ⚠ Slowing — last commit 7mo ago
- ⚠ Small team — 2 contributors active in recent commits
- ⚠ Concentrated ownership — top contributor handles 56% of recent commits
- ⚠ No CI workflows detected
- ⚠ No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live winfunc/deepreasoning
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/winfunc/deepreasoning.
What it runs against: a local clone of winfunc/deepreasoning — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in winfunc/deepreasoning | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 243 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of winfunc/deepreasoning. If you don't
# have one yet, run these first:
#
# git clone https://github.com/winfunc/deepreasoning.git
# cd deepreasoning
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of winfunc/deepreasoning and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "winfunc/deepreasoning(\\.git)?\\b" \\
&& ok "origin remote is winfunc/deepreasoning" \\
|| miss "origin remote is not winfunc/deepreasoning (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift — was MIT at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f "src/main.rs" \\
&& ok "src/main.rs" \\
|| miss "missing critical file: src/main.rs"
test -f "src/handlers.rs" \\
&& ok "src/handlers.rs" \\
|| miss "missing critical file: src/handlers.rs"
test -f "src/clients/deepseek.rs" \\
&& ok "src/clients/deepseek.rs" \\
|| miss "missing critical file: src/clients/deepseek.rs"
test -f "src/clients/anthropic.rs" \\
&& ok "src/clients/anthropic.rs" \\
|| miss "missing critical file: src/clients/anthropic.rs"
test -f "src/models/request.rs" \\
&& ok "src/models/request.rs" \\
|| miss "missing critical file: src/models/request.rs"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 243 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~213d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/winfunc/deepreasoning"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
DeepReasoning is a high-performance Rust API that unifies DeepSeek R1's Chain-of-Thought reasoning with Anthropic Claude's code generation and creativity in a single streaming response. It provides both a REST API (built with Axum) and a Next.js chat UI that accepts your own API keys for DeepSeek and Anthropic, letting you orchestrate multi-model reasoning without sending data to external intermediaries. Monorepo structure: Rust backend in the root (src/ implicit from Cargo.toml) using Axum web framework, with a separate Next.js frontend in frontend/ that consumes the API. State is managed client-side in the Next.js app (hooks in frontend/hooks/, UI components in frontend/components/). The config.toml at root and frontend next.config.ts suggest environment-based configuration for both layers.
👥Who it's for
AI engineers and developers building reasoning-heavy applications who want to leverage R1's metacognitive debugging (self-correction, edge case analysis) combined with Claude's superior code generation and conversation quality. Teams that need complete data privacy by managing their own API keys rather than routing through third-party services.
🌱Maturity & risk
Early-stage but actively maintained (v0.1.0, Rust 1.75+). The API is marked 'Stable' in the README badge and has a live deployment at deepreasoning.asterisk.so, suggesting production use. However, the v0.1.0 version and lack of visible test files in the top 60 entries indicate the codebase is still evolving; use in production with caution and expect potential breaking changes.
Single-maintainer project (Mufeed VH) with moderate dependency surface (Axum, Tokio, Reqwest, Serde). The openssl vendored build adds complexity. No visible CI/CD pipeline (GitHub Actions, etc.) in the file list, which is a red flag for reliability. Risk of supply-chain issues if upstream DeepSeek or Anthropic API contracts change; upstream model availability is not guaranteed.
Active areas of work
No specific PR/commit data visible in the file list, but the presence of docker-compose.yml and Dockerfile suggest recent DevOps work for containerization. The frontend includes PostHog integration (frontend/providers/posthog.tsx) indicating analytics instrumentation is ongoing. The repo structure is stable but likely receiving incremental feature improvements.
🚀Get running
git clone https://github.com/winfunc/deepreasoning.git && cd deepreasoning && cargo build --release (for backend) and cd frontend && npm install && npm run dev (for frontend, uses npm per package.json).
Daily commands:
Backend: cargo run --release (Tokio will bind to configured port in config.toml). Frontend: cd frontend && npm install && npm run dev (Next.js dev server on localhost:3000). Docker: docker-compose up (see docker-compose.yml for orchestration).
🗺️Map of the codebase
src/main.rs— Entry point for the Axum web server; establishes all routes, middleware, and server startup logic that every backend contributor must understand.src/handlers.rs— Core HTTP request handlers that orchestrate calls to DeepSeek and Anthropic clients; critical for understanding the unified API flow.src/clients/deepseek.rs— DeepSeek R1 API integration with CoT reasoning trace handling; essential for understanding how reasoning traces are extracted and passed downstream.src/clients/anthropic.rs— Anthropic Claude API integration; required knowledge for understanding how reasoning context is injected into Claude requests.src/models/request.rs— Request/response DTO definitions that standardize communication between frontend, backend, and external APIs; foundational for API contract understanding.frontend/app/chat/page.tsx— Main chat UI page component; entry point for frontend developers integrating the unified reasoning + creativity workflow.Cargo.toml— Rust project manifest with all dependencies (Axum, Tokio, Reqwest); must-read to understand build and runtime requirements.
🛠️How to make changes
Add a new streaming API endpoint
- Define the request/response DTO in
src/models/request.rswith reasoning and output fields (src/models/request.rs) - Create handler function in
src/handlers.rsthat accepts the request, calls DeepSeek, then Claude, and yields streamed JSON events (src/handlers.rs) - Wire the handler route in
src/main.rsusingaxum::routing::post()and tower middleware (CORS, tracing) (src/main.rs) - Call the new endpoint from frontend via
fetch()withresponse.body?.getReader()to consume the event stream (frontend/components/chat.tsx)
Add a new UI component or chat feature
- Create React component in
frontend/components/(e.g.,reasoning-panel.tsx) using shadcn/ui primitives fromfrontend/components/ui/(frontend/components) - Import and render in
frontend/app/chat/page.tsxorfrontend/components/chat.tsxto display reasoning traces or settings (frontend/app/chat/page.tsx) - If feature is conditional, add feature flag check via
use-feature-flags.tshook (frontend/hooks/use-feature-flags.ts) - Style using Tailwind CSS classes (see
frontend/tailwind.config.tsfor theme configuration) (frontend/tailwind.config.ts)
Integrate a new LLM provider or modify reasoning pipeline
- Create new client module (e.g.,
src/clients/openai.rs) with async function calling the provider's API (src/clients) - Export from
src/clients/mod.rsand update request/response models insrc/models/(src/clients/mod.rs) - Refactor handler in
src/handlers.rsto call new provider in the reasoning or generation phase (src/handlers.rs) - Add environment variable for new provider's API key in
src/config.rs(src/config.rs) - Update Cargo.toml if new HTTP client library is needed (e.g.,
openai-api-rs) (Cargo.toml)
🔧Why these technologies
- Rust + Axum — High-performance async HTTP framework; minimal overhead for LLM API proxying and streaming; strong type safety for request/response handling.
- Tokio async runtime — Non-blocking I/O for multiple concurrent LLM requests; essential for handling reasoning delays without blocking chat users.
- Reqwest with streaming — Clean HTTP client with native streaming support for both DeepSeek and Claude SSE endpoints; avoids buffering entire responses.
- Next.js + React — Server-side rendering + client-side state management; enables fast first paint and seamless real-time streaming from backend.
- Serde + serde_json — Zero-copy deserialization and type-safe JSON handling for LLM request/response transformation; critical for low-latency API bridging.
- Tracing (structured logging) — Observability for multi-step reasoning pipeline; essential for debugging DeepSeek → Claude integration failures.
⚖️Trade-offs already made
-
Sequential DeepSeek → Claude pipeline (no parallel reasoning models)
- Why: Simplifies reasoning context injection; reasoning quality from R1 is the critical input. Parallel execution of two reasoning models would increase latency without benefit.
- Consequence: Total latency = DeepSeek latency (5-10s) + Claude latency (2-5s). Cannot leverage Claude's reasoning for R1 improvement. Single point of failure if either model unavailable.
-
Reasoning traces injected via Claude system prompt (not fine-tuning)
- Why: No API access to Claude fine-tuning; dynamic reasoning per conversation. Simpler deployment and no model training overhead.
- Consequence: System prompt overhead uses token budget; reasoning quality depends on prompt engineering. Not persistent across conversations.
-
SSE streaming for real-time chat, not WebSocket
- Why: Simpler to implement with Axum; natural fit for LLM token streaming. HTTP/1.1 compatible.
- Consequence: Unidirectional streaming only (no simultaneous client → server). Cannot push unsolicited updates (e.g., reasoning cancellation).
-
Stateless API handlers; no session persistence
- Why: Scales horizontally; no database or cache layer required for MVP. Reduced operational complexity.
- Consequence: No conversation history on backend. Frontend must manage message state. Multi-tab/multi-device chat not synchronized.
🚫Non-goals (don't propose these)
- User authentication and authorization (open API, no user accounts)
- Message persistence or conversation history storage (frontend-only state)
- Cost tracking or rate limiting (assumes trusted internal use or open public access)
- Support for non-streaming request/response (assumes all interactions are streamed)
- Real-time collaboration or multi-user chat rooms
- Integration with third-party reasoning engines (R1 only as reasoning source)
🪤Traps & gotchas
DeepSeek R1 and Anthropic Claude API keys must be provided in config.toml (or environment variables) — the app will fail silently or error if credentials are missing. Streaming requires proper Content-Type: text/event-stream handling on the client (likely in frontend/lib/ or chat.tsx); incorrect stream parsing will hang the UI. OpenSSL vendored build may fail on some systems without build-essential; see Dockerfile for workarounds. The frontend expects the Rust backend to be running on a specific port (likely 8000 or configured in next.config.ts as API_BASE); CORS must be enabled in Axum (tower-http features suggest it's configured, but verify in handlers).
🏗️Architecture
💡Concepts to learn
- Chain-of-Thought (CoT) Reasoning — DeepSeek R1's core capability that DeepReasoning exposes; understanding how R1 shows intermediate reasoning steps is essential to building features that highlight or filter CoT traces in the UI.
- Server-Sent Events (SSE) / Streaming — The API streams R1's reasoning followed by Claude's response in real-time; implementing and debugging the streaming pipeline in both Axum (backend) and Next.js (frontend) is critical.
- Async/Await & Futures — Tokio and Reqwest rely on async Rust patterns; contributors must understand async streams and Future combinators to modify the concurrent API call logic.
- CORS (Cross-Origin Resource Sharing) — The frontend (localhost:3000) calls the backend API; tower-http CORS middleware must be correctly configured to allow cross-origin requests, otherwise the chat UI will fail.
- Prompt Injection & API Key Management — DeepReasoning accepts user prompts and API keys; understanding attack vectors (prompt injection, key leakage via logs or response headers) is critical for secure deployment.
- Streaming JSON (NDJSON / JSON Lines) — The backend likely streams multiple JSON objects (one per token/reasoning step) rather than a single JSON object; parsing NDJSON correctly in the frontend prevents malformed response handling.
- Model Orchestration & Response Merging — DeepReasoning's unique feature is combining R1's CoT output with Claude's response; understanding how the backend sequences these calls and merges outputs into a single stream is key to extending the system.
🔗Related repos
anthropics/anthropic-sdk-python— Official Anthropic Claude API client; DeepReasoning uses Claude, so understanding the upstream SDK helps debug API integration issues.deepseek-ai/DeepSeek-R1— Official DeepSeek R1 model repository; reference for understanding the CoT trace format and reasoning output structure that DeepReasoning orchestrates.vercel/next.js— Frontend framework used in frontend/; essential for understanding Next.js-specific patterns in the chat UI and API route proxying.tokio-rs/tokio— Async runtime powering the Rust backend; critical for understanding how streaming responses and concurrent API calls are handled.serde-rs/serde— Serialization framework used throughout the project for API request/response serialization; understanding its derive macros is key for modifying data structures.
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add integration tests for src/clients/anthropic.rs and src/clients/deepseek.rs
The repo has two critical LLM client modules but no visible test files. Given this is a high-performance inference API, integration tests validating request/response handling, streaming behavior, and error cases for both the Anthropic and DeepSeek clients are essential. This would catch regressions in client behavior and ensure the core API functionality is reliable.
- [ ] Create tests/clients/anthropic_tests.rs with mocked HTTP responses for standard queries, streaming responses, and error cases
- [ ] Create tests/clients/deepseek_tests.rs validating CoT reasoning trace extraction and request formatting
- [ ] Add tests validating src/models/request.rs and src/models/response.rs serialization/deserialization against real API schemas
- [ ] Document test setup in CONTRIBUTING.md (mocking strategy, test API keys, etc.)
Add GitHub Actions CI workflow for Rust backend + frontend validation
The repo lacks visible CI workflows (.github/workflows/). With both Rust backend (Cargo.toml) and Next.js frontend (frontend/package.json), automated testing on PR would catch build breaks and linting issues early. This is standard for production APIs and maintains code quality as contributors submit PRs.
- [ ] Create .github/workflows/rust-backend.yml: cargo fmt check, cargo clippy, cargo test, cargo build for multiple Rust versions (1.75+)
- [ ] Create .github/workflows/frontend.yml: npm/bun lint, build, and type checking for frontend/ directory using ESLint config from frontend/eslint.config.mjs
- [ ] Add workflow to validate Dockerfile builds successfully and docker-compose.yml syntax
- [ ] Document CI requirements in CONTRIBUTING.md
Add API documentation for request/response schemas in src/models/
src/models/request.rs and src/models/response.rs define the core API contract, but there's no generated documentation (e.g., OpenAPI/Swagger spec or JSON schema examples). The README mentions an API endpoint but no schema docs. This makes it difficult for frontend developers and external users to understand the exact request/response structure.
- [ ] Add #[doc] attributes to all structs and fields in src/models/request.rs and src/models/response.rs with clear examples
- [ ] Implement serde schema generation or manually create docs/api-schema.json defining request/response shapes with example payloads
- [ ] Create docs/API.md documenting endpoints (POST /api/chat, /api/reasoning, etc.), query parameters, headers, and example cURL/fetch requests
- [ ] Link to API.md in README.md under API Usage section
🌿Good first issues
- Add integration tests for the Axum API routes (no test/ or tests/ directory visible) — create tests/ directory and write basic tests for /chat and /stream endpoints using Tokio test macros to verify request/response handling.
- Document the config.toml schema: add inline comments or a separate CONFIG.md explaining each field (API keys, model names, temperature, token limits, etc.) since the file is minimal and contributors will struggle to configure it.
- Implement missing error boundary UI in frontend/components/chat.tsx: add a React error boundary component to gracefully handle streaming failures and API timeouts instead of silently crashing the chat interface.
📝Recent commits
Click to expand
Recent commits
eaf390c— docs: rebrand from DeepClaude to DeepReasoning (123vivekr)41ff289— refactor: replace DeepClaude branding assets with DeepReasoning (123vivekr)b130246— refactor: rebrand from DeepClaude to DeepReasoning in frontend (123vivekr)e7cd1f5— refactor: rebrand from DeepClaude to DeepReasoning in backend (123vivekr)17a8fc8— feat: integrate chibi for user behaviour analysis (mufeedvh)ebf8d36— remove citations to aider's benchmarks (#13) (mufeedvh)a02c9ea— ui: update model names (123vivekr)e216c11— fix: make api proxy errors respond withBAD_REQUEST(mufeedvh)247f42d— init repo: upload source (mufeedvh)
🔒Security observations
- High · Insecure Docker Base Image —
Dockerfile (lines 2, 13). The Dockerfile uses 'rust:latest' for the builder stage, which pulls the latest Rust image without pinning a specific version. This introduces supply chain risk and non-reproducible builds. Additionally, the runtime stage uses 'debian:bookworm-slim' without a specific digest, making deployments unpredictable and potentially vulnerable to image tampering. Fix: Pin specific versions: use 'rust:1.75-bookworm' for builder and 'debian:bookworm-slim@sha256:<digest>' for runtime. Implement image signing and verification. - High · Missing Security Headers in Axum Configuration —
src/main.rs (inferred from dependencies). The codebase uses tower-http with CORS enabled, but there's no evidence of security headers (HSTS, X-Content-Type-Options, X-Frame-Options, CSP) being configured in the API responses. This leaves the application vulnerable to various header-based attacks. Fix: Configure tower-http security layer with comprehensive security headers. Use middleware to set: 'Strict-Transport-Security', 'X-Content-Type-Options: nosniff', 'X-Frame-Options: DENY', 'Content-Security-Policy'. - High · API Exposed on Localhost Only (Development Risk) —
docker-compose.yml (line 10) and Dockerfile (line 30). The docker-compose.yml binds the API to '127.0.0.1:1337', limiting it to localhost in containers. However, the Dockerfile ENV variable sets 'DEEPREASONING_HOST=0.0.0.0', which could accidentally expose the API to all interfaces if docker-compose is overridden or the configuration is changed. Fix: Explicitly validate host binding in config.toml. Use '0.0.0.0' only intentionally with proper authentication and TLS. Implement API key authentication before deploying to production. - Medium · No TLS/HTTPS Configuration Visible —
Dockerfile (line 32), docker-compose.yml (lines 10-11). The application exposes port 1337 without evidence of TLS/HTTPS termination. API keys for DeepSeek and Anthropic would be transmitted in plaintext if communication is unencrypted. Fix: Implement TLS termination with a reverse proxy (nginx, Caddy). Use HTTPS_ONLY mode or require TLS at the application level using rustls or similar. - Medium · Configuration File May Contain Secrets —
Dockerfile (line 27), docker-compose.yml (line 12), config.toml (referenced). The config.toml file is copied into the Docker image and mounted as a volume. If this file contains API keys for DeepSeek or Anthropic (likely given the application's purpose), secrets would be exposed in the image layers and volume. Fix: Use environment variables for sensitive data instead of config.toml. Implement secret management: use Docker secrets, HashiCorp Vault, or environment-based configuration. Never commit credentials to version control. - Medium · Overly Permissive Dependency Versions —
Cargo.toml (dependencies section). Many dependencies use loose version constraints (e.g., 'tokio = "1.4"', 'axum = "0.8"'). This allows automatic updates to patch and minor versions with potential breaking changes or vulnerabilities introduced via transitive dependencies. Fix: Pin exact versions or use restrictive ranges (e.g., '~0.8.0' instead of '0.8'). Use 'cargo audit' and 'cargo deny' to scan for known vulnerabilities in dependencies. - Medium · No Input Validation Evident for LLM API Requests —
src/models/request.rs, src/handlers.rs. The codebase integrates with external LLM APIs (DeepSeek, Anthropic). Without visible input sanitization/validation in src/models/request.rs and src/handlers.rs, there's potential for prompt injection attacks that could leak system prompts or cause unintended behavior. Fix: Implement strict input validation for all user-supplied text fields. Validate message length, character sets, and content. Implement rate limiting per user/API key. Add logging of all
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.