高级思想链(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存储库上打开一个问题。