Text Generation
Transformers
Safetensors
English
gemma
fine-tuned
pdf-grounded
zero-hallucination
technical-provenance
text-generation-inference
Instructions to use singtan/solvrays-llm-pdf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use singtan/solvrays-llm-pdf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="singtan/solvrays-llm-pdf")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("singtan/solvrays-llm-pdf") model = AutoModelForCausalLM.from_pretrained("singtan/solvrays-llm-pdf") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use singtan/solvrays-llm-pdf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "singtan/solvrays-llm-pdf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "singtan/solvrays-llm-pdf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/singtan/solvrays-llm-pdf
- SGLang
How to use singtan/solvrays-llm-pdf 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 "singtan/solvrays-llm-pdf" \ --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": "singtan/solvrays-llm-pdf", "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 "singtan/solvrays-llm-pdf" \ --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": "singtan/solvrays-llm-pdf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use singtan/solvrays-llm-pdf with Docker Model Runner:
docker model run hf.co/singtan/solvrays-llm-pdf
| license: apache-2.0 | |
| library_name: transformers | |
| base_model: google/gemma-2b | |
| tags: | |
| - text-generation | |
| - fine-tuned | |
| - pdf-grounded | |
| - zero-hallucination | |
| - technical-provenance | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| # ποΈ Solvrays Llm Pdf (Grounded Version) | |
| ## π Overview | |
| This is a specialized, fine-tuned version of **Gemma 2B** optimized for **Ground-Truth Technical Retrieval**. Unlike standard LLMs, this model has been conditioned through specific "Senior AI Engineering" grounding templates to minimize hallucinations and prioritize information extracted directly from technical documentation. | |
| ### π Key Capabilities | |
| - **Zero-Hallucination Mode**: Configured for deterministic greedy decoding. | |
| - **Direct Provenance**: Trained to recognize specific technical documents as "Ground Truth". | |
| - **Infrastructure Focused**: Fine-tuned on complex architectural guidelines (e.g., Saturn Project components). | |
| - **Merged Weights**: Standalone weights for high-speed, native inference. | |
| ## π» Grounded Quick Start (Precise Inference) | |
| To get the most accurate, non-hallucinatory responses, use the following grounded prompt: | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| import torch | |
| model_id = "singtan/solvrays-llm-pdf" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.float16) | |
| # MUST use the Ground-Truth prompt template | |
| prompt = "Based strictly on the provided architectural documentation, provide a precise summary of technical insights." | |
| inputs = tokenizer(prompt, return_tensors="pt").to(model.device) | |
| with torch.no_grad(): | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=256, | |
| do_sample=False, # Force deterministic facts | |
| repetition_penalty=1.5 | |
| ) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |
| ``` | |
| ## π Engineering Specifications | |
| - **Strategy**: SFT (Supervised Fine-Tuning) with Grounding Headers. | |
| - **Rank (r)**: 16 (High capacity for technical fact retention). | |
| - **Epochs**: 5 (Heavy Fact Reinforcement). | |
| - **Context Window**: 512 with 128-token overlap for fact-continuity. | |
| ## β οΈ Usage Recommendations | |
| For production-grade accuracy, always verify specific numeric values with the original PDF. This model is intended for summarizing and retrieving architectural concepts documented in its training corpus. | |
| --- | |
| **Scientifically Fine-tuned by Bibek Lama Singtan** | |