chitchat
原文 chitchat
I recently worked on another project called [chitchat](https://github.com/rexarski/chitchat), which I featured in my school/work side project [climate-plus](https://github.com/rexarski/climate-plus). Chitchat serves as an extension to the chatgpt (gpt-3.5 model, in particular) and offers additional functionalities like file input and question handling. One of the key takeaways from this project, for me, was understanding how [`langchain`](https://github.com/hwchase17/langchain) acts as the intermediary between LLM and vector search.To summarize the mechanism behind chitchat, I’ll quote gaoce’s blog post here:
Context-learning is one of the most impressive abilities of LLM, but it comes with limitations that affect the user experience. However, vector search provides a clever workaround:
- Divide text that exceeds the context length into shorter chunks and convert these chunks into vectors (embeddings).
- Convert the input prompt into a vector (embedding) before sending it to LLM.
- Perform a search on the prompt vector to find the most similar chunk vector.
- Concatenate the most similar chunk vector with the prompt vector, and use it as input for LLM.
chitchat is currently a work-in-progress with limited functionality. However, the advantage is that it’s (almost) free for self-host, and you have complete control over your own data. The processed files are not stored anywhere other than within the project’s environment. Both CLI and GUI versions are ready for use.
Some further improvements are in consideration, such as enhancing the file parsing functionality of chitchat. I am dedicated to refining the project and exploring new avenues to make it even more valuable and user-friendly.
以下为 GPT-4o 翻译内容:
以下是文章内容的翻译:
我最近参与了另一个项目,叫做 chitchat,我在我的学校/工作副项目 climate-plus 中展示了它。Chitchat作为chatgpt(特别是gpt-3.5模型)的扩展,提供了额外的功能,如文件输入和问题处理。对于我来说,这个项目的一个关键收获是理解 langchain
如何作为LLM和向量搜索之间的中介。
为了总结chitchat背后的机制,我引用了 gaoce 的博客文章:
上下文学习是LLM最令人印象深刻的能力之一,但它存在影响用户体验的限制。然而,向量搜索提供了一个巧妙的解决方案:
- 将超出上下文长度限制的文本划分成较短的 chunks,将不同的 chunks 转换为向量(embedding)。
- 在输入 prompt 到 LLM 之前,也将 prompt 转换为向量(embedding)。
- 将 prompt 向量进行搜索,寻找到最相似的 chunk 向量。
- 将最相似的 chunk 向量与 prompt 向量拼接,作为 LLM 的输入。
chitchat 目前仍在开发中,功能有限。然而,其优势在于它(几乎)可以免费自托管,并且你对自己的数据拥有完全的控制权。处理过的文件不会存储在项目环境之外的任何地方。CLI 和 GUI 版本均已准备好使用。
我们正在考虑一些进一步的改进,例如增强 chitchat 的文件解析功能,致力于完善该项目并探索新的途径,以使其更有价值和用户友好。