Text Generation
Transformers
Safetensors
llama
text-generation-inference
smollm2
portfolio-agent
roleplay
gappu
conversational
Instructions to use mrplexar/PortfolioLLM-RAG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mrplexar/PortfolioLLM-RAG with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mrplexar/PortfolioLLM-RAG") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mrplexar/PortfolioLLM-RAG") model = AutoModelForCausalLM.from_pretrained("mrplexar/PortfolioLLM-RAG", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mrplexar/PortfolioLLM-RAG with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mrplexar/PortfolioLLM-RAG" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrplexar/PortfolioLLM-RAG", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mrplexar/PortfolioLLM-RAG
- SGLang
How to use mrplexar/PortfolioLLM-RAG 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 "mrplexar/PortfolioLLM-RAG" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrplexar/PortfolioLLM-RAG", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mrplexar/PortfolioLLM-RAG" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrplexar/PortfolioLLM-RAG", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mrplexar/PortfolioLLM-RAG with Docker Model Runner:
docker model run hf.co/mrplexar/PortfolioLLM-RAG
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: HuggingFaceTB/SmolLM2-360M-Instruct
|
| 3 |
+
library_name: peft
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- portfolio
|
| 7 |
+
- conversational
|
| 8 |
+
- qlora
|
| 9 |
+
- smollm2
|
| 10 |
+
- personal-agent
|
| 11 |
+
- text-generation
|
| 12 |
+
- custom-persona
|
| 13 |
+
language:
|
| 14 |
+
- en
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Arpit Ramesan's Portfolio AI Agent (SmolLM2-360M)
|
| 18 |
+
|
| 19 |
+
## Model Description
|
| 20 |
+
This is a custom-trained conversational AI agent designed to act as the personal representative for **Arpit Ramesan**, an AI/ML Engineer and aspiring AI Generalist based in Thalassery, Kerala.
|
| 21 |
+
|
| 22 |
+
The model was fine-tuned using QLoRA on a synthetic dataset generated specifically from Arpit's real-world portfolio, resume, and technical blogs. It is optimized to answer questions regarding his career timeline, technical architecture, and creative hubs, using a professional yet conversational tone.
|
| 23 |
+
|
| 24 |
+
- **Developed by:** Arpit Ramesan (@mrplexar)
|
| 25 |
+
- **Model type:** Causal Language Model (Fine-tuned via PEFT/LoRA and merged)
|
| 26 |
+
- **Base model:** `HuggingFaceTB/SmolLM2-360M-Instruct`
|
| 27 |
+
- **Language(s):** English (with internet slang/casual conversational capabilities)
|
| 28 |
+
- **License:** Apache 2.0
|
| 29 |
+
|
| 30 |
+
## Intended Uses & Limitations
|
| 31 |
+
### Intended Use
|
| 32 |
+
This model is specifically designed to be deployed as the backend inference engine for a web-based portfolio OS. It expects a strict ChatML-style prompt structure and a specific system prompt to reliably recall its training.
|
| 33 |
+
|
| 34 |
+
### Limitations
|
| 35 |
+
- **Scope Context:** It is a "Micro-LLM" (360M parameters). While highly efficient, it is strictly domain-specific. Asking it general knowledge questions outside the scope of Arpit's portfolio may result in hallucinations or base-model bleed-through.
|
| 36 |
+
- **Prompt Sensitivity:** The model requires greedy decoding (`temperature=0.01`, `do_sample=False`) and the exact system prompt from its training to avoid identity drift.
|
| 37 |
+
|
| 38 |
+
## How to Get Started with the Model
|
| 39 |
+
Use the code below to run inference using the Hugging Face `InferenceClient`, which requires zero local VRAM and is optimized for lightweight web servers like PythonAnywhere.
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
from huggingface_hub import InferenceClient
|
| 43 |
+
|
| 44 |
+
REPO_ID = "mrplexar/PortfolioLLM-RAG"
|
| 45 |
+
HF_TOKEN = "your_hf_read_token_here"
|
| 46 |
+
|
| 47 |
+
client = InferenceClient(model=REPO_ID, token=HF_TOKEN)
|
| 48 |
+
|
| 49 |
+
SYSTEM_PROMPT = "You are the AI agent for Arpit Ramesan's portfolio. You answer questions about his career, creative projects, and technical skills using a professional, personal, and conversational tone. You know that Arpit is based in Thalassery, Kerala."
|
| 50 |
+
user_msg = "What kind of projects does Arpit build?"
|
| 51 |
+
|
| 52 |
+
# Apply exact training template
|
| 53 |
+
prompt = f"<|im_start|>user\n{SYSTEM_PROMPT}\n\n{user_msg}<|im_end|>\n<|im_start|>assistant\n"
|
| 54 |
+
|
| 55 |
+
reply = client.text_generation(
|
| 56 |
+
prompt,
|
| 57 |
+
max_new_tokens=150,
|
| 58 |
+
temperature=0.01,
|
| 59 |
+
stop_sequences=["<|im_end|>"]
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
print(reply.strip())
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Training Details
|
| 66 |
+
### Training Data
|
| 67 |
+
The model was fine-tuned on a custom JSONL dataset containing 150+ diverse, synthetic Q&A pairs. The dataset was generated using an automated pipeline powered by gemma4:e2b.
|
| 68 |
+
The data encompasses:
|
| 69 |
+
|
| 70 |
+
Personal Biometrics & Timeline (Education at St. Thomas College of Engineering, ML Engineer at Incramania, Intern Lead at Saspo World Tech).
|
| 71 |
+
|
| 72 |
+
Technical Projects (WhatsApp DDoS Defense, Theyyam Detection System, Brain Disease Detection).
|
| 73 |
+
|
| 74 |
+
Live Deployments & Web Architecture.
|
| 75 |
+
|
| 76 |
+
Creative Hubs (YouTube, Spotify Podcasts, Pinterest).
|
| 77 |
+
|
| 78 |
+
Conversational augmentations (internet slang, casual formatting, varied query lengths).
|
| 79 |
+
|
| 80 |
+
## Training Procedure
|
| 81 |
+
The model was trained using QLoRA (Quantized Low-Rank Adaptation) to accommodate hardware constraints (NVIDIA GTX 1650 4GB VRAM) while maximizing parameter updates. The LoRA adapters were subsequently fused into the base model weights for seamless API deployment.
|
| 82 |
+
|
| 83 |
+
## Training Hyperparameters
|
| 84 |
+
- **Precision:** 4-bit (nf4) quantization during training, upcast to float16.
|
| 85 |
+
|
| 86 |
+
- **Batch Size:** 1 (with Gradient Accumulation steps = 8).
|
| 87 |
+
|
| 88 |
+
- **Optimizer:** paged_adamw_32bit.
|
| 89 |
+
|
| 90 |
+
- **Learning Rate:** 2e-4 with a cosine learning rate scheduler.
|
| 91 |
+
|
| 92 |
+
- **Max Steps:** 200
|
| 93 |
+
|
| 94 |
+
- **Target Modules:** ["q_proj", "o_proj", "k_proj", "v_proj", "gate_proj", "up_proj", "down_proj"]
|
| 95 |
+
|
| 96 |
+
- **LoRA Rank (r):** 16
|
| 97 |
+
|
| 98 |
+
- **LoRA Alpha:** 32
|
| 99 |
+
|
| 100 |
+
## Hardware & Environment
|
| 101 |
+
Hardware Type: NVIDIA GTX 1650 (Mobile)
|
| 102 |
+
|
| 103 |
+
VRAM Required: ~3.2 GB during QLoRA training
|
| 104 |
+
|
| 105 |
+
Frameworks: transformers, peft, trl, bitsandbytes, torch
|