deepreasoning
A high-performance LLM inference API and Chat UI that integrates DeepSeek R1's CoT reasoning traces with Anthropic Claude models.
Top Related Projects
DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.
Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
Tensors and Dynamic neural networks in Python with strong GPU acceleration
An Open Source Machine Learning Framework for Everyone
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch
Quick Overview
DeepClaude is a Python library that provides an interface for interacting with Anthropic's Claude AI model. It aims to simplify the process of using Claude for various natural language processing tasks, offering a streamlined API and additional utilities for working with the model's responses.
Pros
- Easy-to-use interface for interacting with Claude AI
- Supports multiple conversation modes (single-turn and multi-turn)
- Includes utility functions for processing and analyzing Claude's responses
- Well-documented with clear examples and usage instructions
Cons
- Requires an Anthropic API key, which may have associated costs
- Limited to Claude's capabilities and may not support all NLP tasks
- Dependency on external API means potential downtime or rate limiting
- May require frequent updates to keep up with Claude's evolving capabilities
Code Examples
- Simple query to Claude:
from deepclaude import Claude
claude = Claude(api_key="your_api_key_here")
response = claude.ask("What is the capital of France?")
print(response)
- Multi-turn conversation:
conversation = claude.start_conversation()
conversation.add_user_message("Tell me a joke.")
response1 = conversation.get_response()
print(response1)
conversation.add_user_message("Now explain the joke.")
response2 = conversation.get_response()
print(response2)
- Using utility functions:
from deepclaude.utils import sentiment_analysis
text = "I love using DeepClaude! It's so helpful."
sentiment = sentiment_analysis(text)
print(f"Sentiment: {sentiment}")
Getting Started
To get started with DeepClaude, follow these steps:
-
Install the library:
pip install deepclaude -
Import and initialize the Claude class:
from deepclaude import Claude claude = Claude(api_key="your_api_key_here") -
Start asking questions or having conversations:
response = claude.ask("What's the weather like today?") print(response)
For more advanced usage and additional features, refer to the documentation in the repository.
Competitor Comparisons
DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.
Pros of DeepSpeed
- More comprehensive and mature deep learning optimization library
- Supports a wider range of models and training scenarios
- Actively maintained with frequent updates and contributions
Cons of DeepSpeed
- Steeper learning curve due to its complexity
- May be overkill for simpler projects or smaller models
- Requires more setup and configuration
Code Comparison
DeepSpeed:
import deepspeed
model_engine, optimizer, _, _ = deepspeed.initialize(
args=args,
model=model,
model_parameters=params
)
deepclaude:
from deepclaude import DeepClaude
model = DeepClaude(model_path)
output = model.generate("Your prompt here")
DeepSpeed offers a more complex initialization process, reflecting its broader scope and flexibility. deepclaude provides a simpler interface focused on text generation with Claude models.
DeepSpeed is better suited for large-scale deep learning projects requiring advanced optimization techniques, while deepclaude is more appropriate for quick implementation of Claude-based text generation tasks.
Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
Pros of Horovod
- Mature, widely-used distributed deep learning framework with extensive documentation
- Supports multiple deep learning frameworks (TensorFlow, PyTorch, MXNet)
- Highly scalable for large-scale distributed training across many GPUs/nodes
Cons of Horovod
- More complex setup and configuration compared to DeepClaude
- Steeper learning curve for beginners in distributed training
- Requires more code changes to existing models for integration
Code Comparison
DeepClaude:
import deepclaude as dc
model = dc.load_model("gpt2")
dc.distribute(model, gpus=[0, 1, 2, 3])
Horovod:
import horovod.tensorflow as hvd
hvd.init()
config = tf.ConfigProto()
config.gpu_options.visible_device_list = str(hvd.local_rank())
Summary
Horovod is a more established and feature-rich framework for distributed deep learning, offering support for multiple backends and excellent scalability. However, it comes with a steeper learning curve and more complex setup. DeepClaude appears to be a simpler alternative, potentially easier for beginners to get started with distributed training, but likely with fewer advanced features and less extensive documentation compared to Horovod.
Tensors and Dynamic neural networks in Python with strong GPU acceleration
Pros of PyTorch
- Extensive ecosystem with wide industry adoption and community support
- Comprehensive documentation and tutorials for various deep learning tasks
- Flexible and dynamic computational graph for easier debugging
Cons of PyTorch
- Steeper learning curve for beginners compared to DeepClaude
- Larger codebase and installation size
- More complex setup process for certain environments
Code Comparison
PyTorch:
import torch
x = torch.tensor([1, 2, 3])
y = torch.tensor([4, 5, 6])
z = torch.matmul(x, y)
DeepClaude:
import deepclaude as dc
x = dc.array([1, 2, 3])
y = dc.array([4, 5, 6])
z = dc.dot(x, y)
Summary
PyTorch offers a robust and widely-used deep learning framework with extensive features and community support. However, it may be more complex for beginners and require more resources. DeepClaude appears to be a simpler alternative, potentially easier to learn and use, but likely with fewer advanced features and less community support. The code comparison shows similar basic syntax, with PyTorch using its own tensor objects and DeepClaude using array-like structures.
An Open Source Machine Learning Framework for Everyone
Pros of TensorFlow
- Extensive ecosystem with robust documentation and community support
- Highly scalable for large-scale machine learning projects
- Supports both research and production environments
Cons of TensorFlow
- Steeper learning curve for beginners
- Can be slower for prototyping compared to more lightweight frameworks
- Larger file size and memory footprint
Code Comparison
TensorFlow:
import tensorflow as tf
model = tf.keras.Sequential([
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
DeepClaude:
# No public code available for comparison
Additional Notes
TensorFlow is a well-established, comprehensive machine learning framework with a vast array of features and capabilities. It's widely used in both academia and industry for various AI applications.
DeepClaude appears to be a smaller, more specialized project. Without access to its codebase or detailed documentation, it's challenging to make a direct comparison. It may offer specific functionalities or optimizations for certain use cases, but its scope and capabilities are likely more limited compared to TensorFlow's extensive ecosystem.
For most general machine learning tasks, TensorFlow would be the more versatile and well-supported choice. However, DeepClaude might have advantages in niche scenarios or for specific requirements that aren't apparent without more information.
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Pros of transformers
- Extensive library with support for numerous pre-trained models and architectures
- Well-documented with comprehensive examples and tutorials
- Large and active community for support and contributions
Cons of transformers
- Steeper learning curve due to its extensive features and options
- Larger package size and potentially higher resource requirements
- May be overkill for simpler NLP tasks or projects
Code comparison
transformers:
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
result = classifier("I love this product!")[0]
print(f"Label: {result['label']}, Score: {result['score']:.4f}")
deepclaude:
from deepclaude import DeepClaude
dc = DeepClaude()
result = dc.analyze_sentiment("I love this product!")
print(f"Sentiment: {result.sentiment}, Score: {result.score:.4f}")
Summary
transformers offers a comprehensive solution for various NLP tasks with extensive model support, while deepclaude appears to be a more focused tool, potentially easier to use for specific applications. The choice between them depends on the project's complexity, required features, and the developer's familiarity with each library.
A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch
Pros of apex
- Developed and maintained by NVIDIA, a leader in GPU technology
- Optimized for NVIDIA GPUs, offering high-performance mixed precision training
- Extensive documentation and examples for various deep learning tasks
Cons of apex
- Primarily focused on NVIDIA hardware, limiting compatibility with other platforms
- Requires more setup and configuration compared to simpler alternatives
- May have a steeper learning curve for beginners in deep learning
Code Comparison
apex:
from apex import amp
model, optimizer = amp.initialize(model, optimizer, opt_level="O1")
with amp.scale_loss(loss, optimizer) as scaled_loss:
scaled_loss.backward()
deepclaude:
# No equivalent code available for comparison
# deepclaude appears to be a different type of project
Additional Notes
deepclaude seems to be a smaller, less well-known project compared to apex. It's difficult to make a direct code comparison as the repositories serve different purposes. apex is focused on optimizing deep learning training, while deepclaude's purpose is not immediately clear from the available information.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
DeepReasoning ð¬ð§
Harness the power of DeepSeek R1's reasoning and Claude's creativity and code generation capabilities with a unified API and chat interface.
Getting Started ⢠Features ⢠API Usage ⢠Documentation ⢠Self-Hosting ⢠Contributing
[!NOTE] Disclaimer: This project is not affiliated with, endorsed by, or sponsored by Anthropic. Claude is a trademark of Anthropic, PBC. This is an independent developer project using Claude.
Table of Contents
- Overview
- Features
- Why R1 + Claude?
- Getting Started
- API Usage
- Configuration Options
- Self-Hosting
- Security
- Contributing
- License
- Acknowledgments
Overview
DeepReasoning is a high-performance LLM inference API that combines DeepSeek R1's Chain of Thought (CoT) reasoning capabilities with Anthropic Claude's creative and code generation prowess. It provides a unified interface for leveraging the strengths of both models while maintaining complete control over your API keys and data.
Features
ð Zero Latency - Instant responses with R1's CoT followed by Claude's response in a single stream, powered by a high-performance Rust API
ð Private & Secure - End-to-end security with local API key management. Your data stays private
âï¸ Highly Configurable - Customize every aspect of the API and interface to match your needs
ð Open Source - Free and open-source codebase. Contribute, modify, and deploy as you wish
ð¤ Dual AI Power - Combine DeepSeek R1's reasoning with Claude's creativity and code generation
ð Managed BYOK API - Use your own API keys with our managed infrastructure for complete control
Why R1 + Claude?
DeepSeek R1's CoT trace demonstrates deep reasoning to the point of an LLM experiencing "metacognition" - correcting itself, thinking about edge cases, and performing quasi Monte Carlo Tree Search in natural language.
However, R1 lacks in code generation, creativity, and conversational skills. Claude 3.5 Sonnet excels in these areas, making it the perfect complement. DeepReasoning combines both models to provide:
- R1's exceptional reasoning and problem-solving capabilities
- Claude's superior code generation and creativity
- Fast streaming responses in a single API call
- Complete control with your own API keys
Getting Started
Prerequisites
- Rust 1.75 or higher
- DeepSeek API key
- Anthropic API key
Installation
- Clone the repository:
git clone https://github.com/getasterisk/deepreasoning.git
cd deepreasoning
- Build the project:
cargo build --release
Configuration
Create a config.toml file in the project root:
[server]
host = "127.0.0.1"
port = 3000
[pricing]
# Configure pricing settings for usage tracking
API Usage
See API Docs
Basic Example
import requests
response = requests.post(
"http://127.0.0.1:1337/",
headers={
"X-DeepSeek-API-Token": "<YOUR_DEEPSEEK_API_KEY>",
"X-Anthropic-API-Token": "<YOUR_ANTHROPIC_API_KEY>"
},
json={
"messages": [
{"role": "user", "content": "How many 'r's in the word 'strawberry'?"}
]
}
)
print(response.json())
Streaming Example
import asyncio
import json
import httpx
async def stream_response():
async with httpx.AsyncClient() as client:
async with client.stream(
"POST",
"http://127.0.0.1:1337/",
headers={
"X-DeepSeek-API-Token": "<YOUR_DEEPSEEK_API_KEY>",
"X-Anthropic-API-Token": "<YOUR_ANTHROPIC_API_KEY>"
},
json={
"stream": True,
"messages": [
{"role": "user", "content": "How many 'r's in the word 'strawberry'?"}
]
}
) as response:
response.raise_for_status()
async for line in response.aiter_lines():
if line:
if line.startswith('data: '):
data = line[6:]
try:
parsed_data = json.loads(data)
if 'content' in parsed_data:
content = parsed_data.get('content', '')[0]['text']
print(content, end='',flush=True)
else:
print(data, flush=True)
except json.JSONDecodeError:
pass
if __name__ == "__main__":
asyncio.run(stream_response())
Configuration Options
The API supports extensive configuration through the request body:
{
"stream": false,
"verbose": false,
"system": "Optional system prompt",
"messages": [...],
"deepseek_config": {
"headers": {},
"body": {}
},
"anthropic_config": {
"headers": {},
"body": {}
}
}
Self-Hosting
DeepReasoning can be self-hosted on your own infrastructure. Follow these steps:
- Configure environment variables or
config.toml - Build the Docker image or compile from source
- Deploy to your preferred hosting platform
Security
- No data storage or logged
- BYOK (Bring Your Own Keys) architecture
- Regular security audits and updates
Contributing
We welcome contributions! Please see our Contributing Guidelines for details on:
- Code of Conduct
- Development process
- Submitting pull requests
- Reporting issues
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
DeepReasoning is a free and open-source project by Asterisk. Special thanks to:
- DeepSeek for their incredible R1 model
- Anthropic for Claude's capabilities
- The open-source community for their continuous support
Top Related Projects
DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.
Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
Tensors and Dynamic neural networks in Python with strong GPU acceleration
An Open Source Machine Learning Framework for Everyone
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot