Skip to main content

Ragnarök

PyPI Downloads Downloads

LICENSE

Ragnarök is a battleground for the best retrieval-augmented generation (RAG) models!

📟 Instructions

Source Installation

Create a new conda environment and install the dependencies:

conda create -n ragnarok python=3.10 -y
conda activate ragnarok
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # For CUDA 11.8
pip install -r requirements.txt

PyPI Installation

pip install pyragnarok

Let's generate!

For example, to run the command-r-plus model on the rag24.researchy-dev_large dataset with bm25 retrieval methods with augmented generation based on the top-20 segments, you can run the following command:

python src/ragnarok/scripts/run_ragnarok.py  --model_path=command-r-plus  --topk=20 \
  --dataset=rag24.researchy-dev  --retrieval_method=bm25 --prompt_mode=cohere  \
  --context_size=8192 --max_output_tokens=1024 

Or to run the gpt-4o model on the rag24.raggy-dev dataset with bm25 followed by rank_zephyr_rho retrieval methods, with augmented generation based on the top-5 segments, you can run the following command:

python src/ragnarok/scripts/run_ragnarok.py  --model_path=gpt-4o  --topk=100,5 \
    --dataset=rag24.raggy-dev  --retrieval_method=bm25,rank_zephyr_rho --prompt_mode=chatqa  \
    --context_size=8192 --max_output_tokens=1024  --use_azure_openai

Contributing

If you would like to contribute to the project, please refer to the contribution guidelines.

🦙🐧 Model Zoo

Most LLMs supported by VLLM/FastChat should additionally be supported by Ragnarök too, albeit we do not test all of them. If you would like to see a specific model added, please open an issue or a pull request. The following is a table of generation models which we regularly use with Ragnarök:

Model Name Identifier/Link
GPT-4o gpt-4o
GPT-4 gpt-4
GPT-3.5-turbo gpt-35-turbo
command-r-plus command-r-plus
command-r command-r
Llama-3 8B Instruct meta-llama/Meta-Llama-3-8B-Instruct
Llama3-ChatQA-1.5 nvidia/Llama3-ChatQA-1.5

✨ References

If you use Ragnarök, please cite the following:

TODO

🙏 Acknowledgments

This research is supported in part by the Natural Sciences and Engineering Research Council (NSERC) of Canada.

Metadata

Release files for pyragnarok 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyragnarok 0.0.1
File Size Uploaded
pyragnarok-0.0.1.tar.gz 37.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyragnarok 0.0.1
File Interpreter ABI Platform
pyragnarok-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 83.6 kB

Release files / pyragnarok-0.0.1.tar.gz

Download URL pyragnarok-0.0.1.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0dc0c015c749c465c4c8c82d921d2fa6a06f53aa84d240f0e6afc18b865ffbb6
BLAKE2b-256 checksum
How to use checksums
94c3598123fa3b36addae7e248fca91d6990b15b9e09595a8b187573116296a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.6

Release files / pyragnarok-0.0.1-py3-none-any.whl

Download URL pyragnarok-0.0.1-py3-none-any.whl
Size 45.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc797830f8b2b5133984f97e739a8ab177205ea03cd19aee3ddccd947da5f94b
BLAKE2b-256 checksum
How to use checksums
321dfc7faf6f6b3e2cf07712a4fc747156dbd09e17e81d3f3ffc5ce8b4257771
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page