163 | {body} 164 |
165 | ) 166 | }) 167 | FormMessage.displayName = "FormMessage" 168 | 169 | export { 170 | useFormField, 171 | Form, 172 | FormItem, 173 | FormLabel, 174 | FormControl, 175 | FormDescription, 176 | FormMessage, 177 | FormField, 178 | } 179 | -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | //! Configuration management for the application. 2 | //! 3 | //! This module handles loading and managing configuration settings from files 4 | //! and environment variables. It includes pricing configurations for different 5 | //! AI model providers and server settings. 6 | 7 | use serde::{Deserialize, Serialize}; 8 | use std::path::Path; 9 | 10 | /// Root configuration structure containing all application settings. 11 | /// 12 | /// This structure is typically loaded from a TOML configuration file 13 | /// and provides access to all configurable aspects of the application. 14 | #[derive(Debug, Deserialize, Serialize, Clone)] 15 | pub struct Config { 16 | pub server: ServerConfig, 17 | pub pricing: PricingConfig, 18 | } 19 | 20 | /// Server-specific configuration settings. 21 | /// 22 | /// Contains settings related to the HTTP server, such as the 23 | /// host address and port number to bind to. 24 | #[derive(Debug, Deserialize, Serialize, Clone)] 25 | pub struct ServerConfig { 26 | pub host: String, 27 | pub port: u16, 28 | } 29 | 30 | /// Pricing configuration for all supported AI models. 31 | /// 32 | /// Contains pricing information for different AI model providers 33 | /// and their various models, used for usage cost calculation. 34 | #[derive(Debug, Deserialize, Serialize, Clone)] 35 | pub struct PricingConfig { 36 | pub deepseek: DeepSeekPricing, 37 | pub anthropic: AnthropicPricing, 38 | } 39 | 40 | /// DeepSeek-specific pricing configuration. 41 | /// 42 | /// Contains pricing rates for different aspects of DeepSeek API usage, 43 | /// including cached and non-cached requests. 44 | #[derive(Debug, Deserialize, Serialize, Clone)] 45 | pub struct DeepSeekPricing { 46 | pub input_cache_hit_price: f64, // per million tokens 47 | pub input_cache_miss_price: f64, // per million tokens 48 | pub output_price: f64, // per million tokens 49 | } 50 | 51 | /// Anthropic-specific pricing configuration. 52 | /// 53 | /// Contains pricing information for different Claude model variants 54 | /// and their associated costs. 55 | #[derive(Debug, Deserialize, Serialize, Clone)] 56 | pub struct AnthropicPricing { 57 | pub claude_3_sonnet: ModelPricing, 58 | pub claude_3_haiku: ModelPricing, 59 | pub claude_3_opus: ModelPricing, 60 | } 61 | 62 | /// Generic model pricing configuration. 63 | /// 64 | /// Contains detailed pricing information for a specific model, 65 | /// including input, output, and caching costs. 66 | #[derive(Debug, Deserialize, Serialize, Clone)] 67 | pub struct ModelPricing { 68 | pub input_price: f64, // per million tokens 69 | pub output_price: f64, // per million tokens 70 | pub cache_write_price: f64, // per million tokens 71 | pub cache_read_price: f64, // per million tokens 72 | } 73 | 74 | impl Config { 75 | /// Loads configuration from the default config file. 76 | /// 77 | /// Attempts to load and parse the configuration from 'config.toml'. 78 | /// Falls back to default values if the file cannot be loaded or parsed. 79 | /// 80 | /// # Returns 81 | /// 82 | /// * `anyhow::Result
6 |
7 | Harness the power of DeepSeek R1's reasoning and Claude's creativity and code generation capabilities with a unified API and chat interface.
8 |
9 | [](https://github.com/getasterisk/deepclaude/blob/main/LICENSE.md)
10 | [](https://www.rust-lang.org/)
11 | [](https://deepclaude.asterisk.so)
12 |
13 | [Getting Started](#getting-started) •
14 | [Features](#features) •
15 | [API Usage](#api-usage) •
16 | [Documentation](#documentation) •
17 | [Self-Hosting](#self-hosting) •
18 | [Contributing](#contributing)
19 |
20 | 76 | Harness the power of DeepSeek R1's reasoning and Claude's creativity and code generation capabilities with a unified API and chat interface. 77 |
78 | 79 |184 | Instant responses of R1s CoT followed with Claude's response in a single stream powered by a high-performance streaming API written in Rust. 185 |
186 |197 | Your data stays private with end-to-end security and local API key management. 198 |
199 |210 | Customize every aspect of the API and interface to match your needs. 211 |
212 |223 | Free and open-source codebase. Contribute, modify, and deploy as you wish. 224 |
225 |236 | Combine DeepSeek R1's reasoning with Claude's creativity and code generation. 237 |
238 |259 | Use your own API keys with our managed infrastructure for complete control and flexibility. 260 |
261 |299 | DeepSeek R1's CoT trace demonstrates deep reasoning to the point of an LLM experiencing "metacognition" - correcting itself, thinking about edge cases, and so on. It's a quasi MCTS in natural language. 300 |
301 |302 | But R1 lacks at code generation, creativity, and conversational skills. The model that excels at all 3 is the Claude 3.5 Sonnet New from Anthropic. So how about we combine both of them? And take the best of both worlds? Enter DeepClaude! 303 |
304 |305 | With DeepClaude, you get a fast streaming R1 CoT + Claude Models in a single API call with your own API keys. 306 |
307 |322 | "R1 as architect with Sonnet as editor has set a new SOTA of 64.0% on the aider polyglot benchmark. They achieve this at 14X less cost compared to the previous o1 SOTA result." - Aider Polyglot Benchmarks. 323 |
324 |348 | Yes, 100% free and you use your own keys. The API wraps both DeepSeek and Anthropic streaming API into one. And you get some niceties like calculating the combined usage and price for you to use. We keep no logs and it's completely open-source - you can self-host it, modify it, redistribute it, whatever. 349 |
350 |351 | Feel free to use this at scale, we use this in production at Asterisk serving millions of tokens in parallel daily and it hasn't failed us "yet". And like all nice things, just don't abuse it. 352 |
353 |372 | No sign up. No credit card. No data stored. 373 |
374 |