Example Use Case Tutorials¶
These end-to-end examples serve as tutorials for the usage of RapidFire AI’s API. They use publicly available datasets, models, and code.
Attention
These notebooks live on RapidFire AI main and use the shard API: num_shards,
save_strategy="shard", and the current RFOptuna() signature. They will not run
unchanged against the 0.16.1 build on PyPI. See
installing from main.
For RAG and Context Engineering¶
We have one use case example each for an all-local model, all-OpenAI, and a hybrid workflow: FiQA RAG Q&A chatbot, SciFact RAG for scientific claim verification, and GSM8K few-shot/context engineering for math reasoning, respectively. This set will expand over time to more examples based on community inputs.
You can also check out RapidFire AI RAG on Google Colab instead of your own machine; it showcases a simplified FiQA RAG Q&A chatbot use case.
For Fine-Tuning and Post-Training¶
We have one use case example for each supported control flow from HuggingFace TRL: SFT, DPO, and GRPO. This set will expand over time to more examples based on community inputs. The SFT use case has multiple additional variations showcased, including a “lite” version with a fast SLM and multiple FSDP-based versions with larger models that are auto-partitioned across GPUs.
You can also check out RapidFire AI on Google Colab instead of your own machine; it showcases a simplified SFT use case.
Adaptive Search with Optuna¶
Instead of enumerating configs with grid or random search, you can hand config generation over to
Optuna, which prunes underperforming runs in flight at shard boundaries and spends the freed
resources on new configs.
See RFOptuna() on the Multi-Config Specification page for the pruning
semantics and the current limitation on the sampler.
There are three examples, two for evals mode and one for fit mode.
Optuna for RAG on FiQA: View on GitHub
Optuna for RAG on SciFact: View on GitHub
Optuna for SFT on customer support Q&A: View on GitHub
Multimodal RAG¶
This example runs RAG over real-world PDFs, parsing text, table, and image elements, summarizing
each into embeddable text, offloading the originals to storage, and indexing the summaries in
Pinecone. It uses the MMDocIR evaluation dataset and needs the multimodal dependencies from
rapidfireai init --multimodal.
Also read the Multimodal RAG and Artifact Storage section of the RAG spec page.
Multimodal RAG on MMDocIR: View on GitHub