偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

LLM-Reasoner:讓任何大模型都能像DeepSeek R1一樣深入思考

發(fā)布于 2025-3-11 01:36
瀏覽
0收藏

LLM-Reasoner 是一個庫,它讓任何 LLM(大模型)都能像 OpenAI o1 和 DeepSeek R1 一樣深入思考。

LLM-Reasoner:讓任何大模型都能像DeepSeek R1一樣深入思考-AI.x社區(qū)

? 主要特點

?? 循序漸進的推理:不再有黑箱答案!準確了解 LLM 是如何思考的,類似于 O1 的系統(tǒng)方法

?? 實時進度:通過流暢的動畫觀看推理的展開

?? 多提供商支持:與 LiteLLM 支持的所有提供商兼容

?? 精美的 UI:一個漂亮的 Streamlit 界面可供使用

??? 高級用戶 CLI:無縫嵌入你的代碼

?? 信心跟蹤:了解 LLM 對每個步驟的確定程度

?? 快速開始

首先安裝:

pip install llm-reasoner

設(shè)置 OpenAI key:

export OPENAI_API_KEY="sk-your-key"

對于國內(nèi)用戶可以選擇提供了與 OpenAI 接口兼容的模型或者是使用 llama_cpp_python 啟動一個本地的 LLM 服務,這個服務接口與 OpenAI 接口兼容。

以下是一些簡單的用法:

# 列當前所有可用模型
llm-reasoner models


# 生成一個推理鏈
llm-reasoner reason "How do planes fly?" --min-steps 5


#啟動 UI 界面
llm-reasoner ui

LLM-Reasoner:讓任何大模型都能像DeepSeek R1一樣深入思考-AI.x社區(qū)

或者直接在你的代碼中使用:

from llm_reasoner import ReasonChain
import asyncio


async def main():
    # Create a chain with your preferred settings
    chain = ReasonChain(
        model="gpt-4",                # Choose your model
        min_steps=3,                  # Minimum reasoning steps
        temperature=0.2,              # Control creativity
        timeout=30.0                  # Set your timeout
    )
    # Watch it think step by step!
    async for step in chain.generate_with_metadata("Why is the sky blue?"):
        print(f"\nStep {step.number}: {step.title}")
        print(f"Thinking Time: {step.thinking_time:.2f}s")
        print(f"Confidence: {step.confidence:.2f}")
        print(step.content)
asyncio.run(main())

??https://github.com/harishsg993010/LLM-Reasoner??

本文轉(zhuǎn)載自??PyTorch研習社??,作者:南七無名式

收藏
回復
舉報
回復
相關(guān)推薦