Views
No views yet
| File | Format | Size |
|---|---|---|
llama-nemotron-rerank-1b-v2-f16.gguf | BF16 | 2.4 GB |
llama-nemotron-rerank-1b-v2-q8_0.gguf | Q8_0 | 1.3 GB |
1# Build llama.cpp (https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md)
2cmake -B build && cmake --build build --config Release -j
3
4# Start the reranking server
5./build/bin/llama-server \
6 -m llama-nemotron-rerank-1b-v2-q8_0.gguf \
7 --reranking \
8 --port 8080 \
9 -ngl 991import requests
2
3response = requests.post("http://localhost:8080/rerank", json={
4 "query": "What is machine learning?",
5 "documents": [
6 "Machine learning is a branch of AI that learns patterns from data.",
7 "Python is a programming language commonly used for data science.",
8 "Bananas are a good source of potassium.",
9 ],
10 "top_n": 3,
11})
12
13for item in response.json()["results"]:
14 print(f"Doc {item['index']}: score={item['relevance_score']:.4f}")