高級思想鏈(COT)推理API(rl)

Fragaria是一條強大而靈活的思想鏈(COT)推理API,它利用各種語言模型(LLM)提供商,並結合了加固學習(RL)技術來解決複雜的問題並回答複雜的問題。 Fragaria以草莓的植物屬命名,向著名的“有多少種草莓中的R?”致敬。問題,象徵著其以同樣的精確處理來解決簡單和復雜查詢的能力。
克隆存儲庫:
git clone https://github.com/terraprompt/fragaria.git
cd fragaria
創建虛擬環境(可選但建議):
python -m venv venv
source venv/bin/activate # On Windows, use `venvScriptsactivate`
安裝所需的依賴項:
pip install -r requirements.txt
將config.yaml.example文件複製到config.yaml :
cp config.yaml.example config.yaml
打開config.yaml並更新以下設置:
llm_provider (OpenAI,Groq或一起)啟動Fragaria API服務器:
python main.py
API將在http://localhost:8000 (或您的配置中指定的主機/端口)提供。
現在,您可以將發布請求發送到http://localhost:8000/v1/chat/completions ,以使用思想推理能力鏈。
Fragaria提供了全面的API文檔:
http://localhost:8000/docshttp://localhost:8000/redochttp://localhost:8000/openapi.json 這是您可以使用Fragaria解決的一些示例問題:
經典的草莓問題:
{
"model" : " faragia-dev " ,
"messages" : [
{ "role" : " user " , "content" : " How many 'r's in strawberry? " }
]
}一個更複雜的與年齡相關的難題:
{
"model" : " faragia-dev " ,
"messages" : [
{ "role" : " user " , "content" : " A princess is as old as the prince will be when the princess is twice as old as the prince was when the princess's age was half the sum of their present age. What is the age of prince and princess? Provide all solutions to that question. " }
]
}要解決這些問題,請以上述JSON有效載荷將郵政請求發送到/v1/chat/completions 。
Fragaria採用了通過增強學習增強的精緻思想鏈(COT)推理過程:
這種RL增強過程使Fragaria不僅可以解決廣泛的問題,而且可以隨著時間的流逝而學習和適應其策略,從而越來越有效地解決熟悉和新穎的問題類型。
我們歡迎對Fragaria的貢獻!請按照以下步驟進行貢獻:
請確保您的代碼遵守項目的編碼標準,並包括針對新功能的測試。
Fragaria根據MIT許可發布。有關詳細信息,請參見許可證文件。
如果您在研究中使用Fragaria或希望在出版物中引用它,請使用以下Bibtex條目:
@software { fragaria2024 ,
author = { {Dipankar Sarkar} } ,
title = { Fragaria: Advanced Chain of Thought Reasoning API with Reinforcement Learning } ,
year = 2024 ,
publisher = { GitHub } ,
journal = { GitHub repository } ,
howpublished = { url{https://github.com/terraprompt/fragaria} } ,
}對於學術論文,您可以將Fragaria引用為:
Dipankar Sarkar。 (2024)。 Fragaria:通過加強學習的高級思想推理API [計算機軟件]。 https://github.com/terraprompt/fragaria
Fragaria由Terraprompt團隊維護。如有任何疑問或支持,請在GitHub存儲庫上打開一個問題。