Instructions to use PleIAs/Pleias-RAG-350M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PleIAs/Pleias-RAG-350M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PleIAs/Pleias-RAG-350M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PleIAs/Pleias-RAG-350M") model = AutoModelForCausalLM.from_pretrained("PleIAs/Pleias-RAG-350M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PleIAs/Pleias-RAG-350M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PleIAs/Pleias-RAG-350M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PleIAs/Pleias-RAG-350M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PleIAs/Pleias-RAG-350M
- SGLang
How to use PleIAs/Pleias-RAG-350M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "PleIAs/Pleias-RAG-350M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PleIAs/Pleias-RAG-350M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "PleIAs/Pleias-RAG-350M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PleIAs/Pleias-RAG-350M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PleIAs/Pleias-RAG-350M with Docker Model Runner:
docker model run hf.co/PleIAs/Pleias-RAG-350M
Add some metadata to the model card
Hello!
Preface
Nice work here! I'm excited to see models of this size for RAG. I'm going to dive more into your official library next.
Pull Request overview
- Add
transformerstag - Add
text-generationpipeline tag
Details
These should make it a tad easier to find this model.
Also, as a heads up, in my experience, a small snippet in the model card with usage is often recommended to get people a good feel of what your model does, e.g.:
rag = RAGWithCitations("PleIAs/Pleias-RAG-350M")
# Define query and sources
query = "What is the capital of France?"
sources = [
{
"text": "Paris is the capital and most populous city of France.",
"metadata": {"source": "Geographic Encyclopedia", "reliability": "high"}
},
{
"text": "The Eiffel Tower is located in Paris, France.",
"metadata": {"source": "Travel Guide", "year": 2020}
}
]
# Generate a response
response = rag.generate(query, sources)
# Print the final answer with citations
print(response["processed"]["clean_answer"])
(Except also include the import & printed output)
- Tom Aarsen
Also, am I correct in understanding that this model should be applied after the Retrieval step in the RAG pipeline?
- Tom Aarsen
Yes exactly on all counts. It's not an embedding model (though a later iteration may come with some search capacities)