❤️ 如果你也关注 AI 的发展现状,且对 AI 应用开发感兴趣,我会每日分享大模型与 AI 领域的开源项目和应用,提供运行实例和实用教程,帮助你快速上手AI技术!
微信公众号|搜一搜:蚝油菜花
大家好,我是蚝油菜花,今天跟大家分享一下 DeepClaude 这个高性能的开源 AI 应用开发平台,深度集成了 DeepSeek R1 和 Claude 模型。
DeepClaude 是一个高性能的开源 AI 应用开发平台,结合了 DeepSeek R1 和 Claude 模型的优势。
DeepClaude 是一个高性能的开源 AI 应用开发平台,结合了 DeepSeek R1 和 Claude 模型的优点。它提供了零延迟的即时响应、端到端加密和本地 API 密钥管理,确保用户数据的安全性。DeepClaude 具有高度可配置性,用户可以自定义 API 和界面,以满足多样化的需求。
DeepClaude 适用于智能聊天机器人、代码自动化生成、推理任务和教育培训等多种场景,帮助企业打造个性化服务或助力开发者高效生成高质量代码。
git clone https://github.com/getasterisk/deepclaude.git
cd deepclaude
cargo build --release
config.toml
创建一个 config.toml
文件在项目根目录:
[server]
host = "127.0.0.1"
port = 3000
[pricing]
# Configure pricing settings for usage tracking
import requests
response = requests.post(
"http://127.0.0.1:1337/",
headers={
"X-DeepSeek-API-Token": "" ,
"X-Anthropic-API-Token": ""
},
json={
"messages": [
{"role": "user", "content": "How many 'r's in the word 'strawberry'?"}
]
}
)
print(response.json())
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": "" ,
"X-Anthropic-API-Token": ""
},
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())
❤️ 如果你也关注 AI 的发展现状,且对 AI 应用开发感兴趣,我会每日分享大模型与 AI 领域的开源项目和应用,提供运行实例和实用教程,帮助你快速上手AI技术!
微信公众号|搜一搜:蚝油菜花