Easily implement RAG workflows with pre-built modules.
Project description
easy_rag_llm
CAUTION
- easy-rag-llm==1.0.* version is testing version. These versions are usually invalid.
๐ฐ๐ท ์๊ฐ
- easy_rag_llm๋ OpenAI ๋ฐ DeepSeek ๋ชจ๋ธ์ ์ง์ํ๋ ๊ฐ๋จํ RAG(์ ๋ณด ๊ฒ์ ๋ฐ ์์ฑ) ๊ธฐ๋ฐ ์๋น์ค๋ฅผ ์ ๊ณตํฉ๋๋ค. ๊ฐ๋จํ๊ฒ RAG LLM์ ์๋น์ค์ ํตํฉ์ํฌ ์ ์๋๋ก ๋ง๋ค์ด์ก์ต๋๋ค.
- (2025.01.16 ๊ธฐ์ค/ v1.0.12) ํ์ต๊ฐ๋ฅํ ์๋ฃ ํฌ๋งท์ PDF์ ๋๋ค.
๐บ๐ธ Introduction
- easy_rag_llm is a lightweight RAG-based service that supports both OpenAI and DeepSeek models. It is designed to seamlessly integrate RAG-based LLM functionalities into your service.
- As of 2025-01-15 (v1.0.0), the supported resource format for training is PDF.
Usage
Install
pip install easy_rag_llm
How to integrate to your service?
from easy_rag import RagService
rs = RagService(
embedding_model="text-embedding-3-small", #Fixed to OpenAI model
response_model="deepseek-chat", # Options: "openai" or "deepseek-chat"
open_api_key="your_openai_api_key_here",
deepseek_api_key="your_deepseek_api_key_here",
deepseek_base_url="https://api.deepseek.com",
)
resource = rs.rsc("./rscFiles", force_update=False) # Learn from all files under ./rscFiles
query = "Explain what is taught in the third week's lecture."
response, top_evidence = rs.generate_response(resource, query)
print(response)
๐ฐ๐ท ์๋ด.
- pdf ์ ๋ชฉ์ ๋ช ํํ๊ฒ ์ ์ด์ฃผ์ธ์. ๋ฉํ๋ฐ์ดํฐ์๋ pdf์ ๋ชฉ์ด ์ถ์ถ๋์ด ๋ค์ด๊ฐ๋ฉฐ, ๋ต๋ณ ๊ทผ๊ฑฐ๋ฅผ ์ถ๋ ฅํ ๋ ์ ์ฉํ๊ฒ ์ฌ์ฉ๋ ์ ์์ต๋๋ค.
rs.rsc("./folder")์๋์faiss_index.bin๊ณผmetadata.json์ด ์์ฑ๋ฉ๋๋ค. ์ดํ์ ์ด๋ฏธ ๋ง๋ค์ด์ง .bin๊ณผ .json์ผ๋ก ๋ต๋ณ์ ์์ฑํฉ๋๋ค. ๋ง์ฝ ํด๋์ ์๋ก์ด ํ์ผ์ ์ถ๊ฐํ๊ฑฐ๋ ์ ๊ฑฐํ์ฌ ๋ณ๊ฒฝํ๊ณ ์ถ๋ค๋ฉดforce_update=True๋ก ์ค์ ํ์ฌ ๊ฐ์ ์ ๋ฐ์ดํธ๊ฐ ๊ฐ๋ฅํฉ๋๋ค.
๐บ๐ธ Note.
- Ensure that your PDFs have clear titles. Extracted titles from the PDF metadata are used during training and for generating evidence-based responses.
- Running
rs.rsc("./folder")generatesfaiss_index.binandmetadata.jsonfiles. Subsequently, the system uses the existing .bin and .json files to generate responses. If you want to reflect changes by adding or removing files in the folder, you can enable forced updates by settingforce_update=True.
release version.
- 1.0.12 : Supported. However, the embedding model and chat model are fixed to OpenAI's text-embedding-3-small and deepseek-chat, respectively. Fixed at threadpool worker=10, which may cause errors in certain environments.
๊ณ ์ณ์ผํ ์ง์
- worker ๊ฐ์ ์์จ์กฐ์ ์ ์ํ ํ๋ผ๋ฏธํฐ ์ถ๊ฐ ํ์
- ์ฐธ๊ณ ํ evidence ๊ฐ์ ์กฐ์ ํ๋ผ๋ฏธํฐ ์ถ๊ฐ ํ์
- api key ์ฌ์ฉ์ด ์์ ๋กญ์ง ์์.
Author Information
- ๊ณฝ๋ณํ (https://github.com/Aiden-Kwak)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
easy_rag_llm-1.0.13.tar.gz
(9.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_rag_llm-1.0.13.tar.gz.
File metadata
- Download URL: easy_rag_llm-1.0.13.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
581ad387a8409c62850371226a3b65ad4135ee1920cb69faafcd2a9a21c481f2
|
|
| MD5 |
d954256650652e0e0ba55fa6138c19db
|
|
| BLAKE2b-256 |
4f06b62ff71901f0955b26cf9297bf23196dd6ff94c609f4c9369e68c1401e46
|
File details
Details for the file easy_rag_llm-1.0.13-py3-none-any.whl.
File metadata
- Download URL: easy_rag_llm-1.0.13-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
780959798b979eef90d245e1e956360758469e19544d913d611253b7f6a0eb74
|
|
| MD5 |
3d1c11a61f33e1e7de597d811bde0961
|
|
| BLAKE2b-256 |
97b20f37710fd36e9e0f1755a618b34d5141535a12e1cf0de1449db8858d0ae4
|