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
Cleanup: Batch removing all files before update
Browse files- .gitattributes +0 -35
- README.md +0 -105
- chat_template.jinja +0 -6
- config.json +0 -40
- generation_config.json +0 -7
- model.safetensors +0 -3
- tokenizer.json +0 -0
- tokenizer_config.json +0 -18
.gitattributes
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
|
@@ -1,105 +0,0 @@
|
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chat_template.jinja
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system
|
| 2 |
-
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
|
| 3 |
-
' }}{% endif %}{{'<|im_start|>' + message['role'] + '
|
| 4 |
-
' + message['content'] + '<|im_end|>' + '
|
| 5 |
-
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 6 |
-
' }}{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"LlamaForCausalLM"
|
| 4 |
-
],
|
| 5 |
-
"attention_bias": false,
|
| 6 |
-
"attention_dropout": 0.0,
|
| 7 |
-
"bos_token_id": 1,
|
| 8 |
-
"dtype": "float32",
|
| 9 |
-
"eos_token_id": 2,
|
| 10 |
-
"head_dim": 64,
|
| 11 |
-
"hidden_act": "silu",
|
| 12 |
-
"hidden_size": 960,
|
| 13 |
-
"initializer_range": 0.02,
|
| 14 |
-
"intermediate_size": 2560,
|
| 15 |
-
"is_llama_config": true,
|
| 16 |
-
"max_position_embeddings": 8192,
|
| 17 |
-
"mlp_bias": false,
|
| 18 |
-
"model_type": "llama",
|
| 19 |
-
"num_attention_heads": 15,
|
| 20 |
-
"num_hidden_layers": 32,
|
| 21 |
-
"num_key_value_heads": 5,
|
| 22 |
-
"pad_token_id": 2,
|
| 23 |
-
"pretraining_tp": 1,
|
| 24 |
-
"rms_norm_eps": 1e-05,
|
| 25 |
-
"rope_interleaved": false,
|
| 26 |
-
"rope_parameters": {
|
| 27 |
-
"rope_theta": 100000,
|
| 28 |
-
"rope_type": "default"
|
| 29 |
-
},
|
| 30 |
-
"tie_word_embeddings": true,
|
| 31 |
-
"transformers.js_config": {
|
| 32 |
-
"kv_cache_dtype": {
|
| 33 |
-
"fp16": "float16",
|
| 34 |
-
"q4f16": "float16"
|
| 35 |
-
}
|
| 36 |
-
},
|
| 37 |
-
"transformers_version": "5.4.0",
|
| 38 |
-
"use_cache": true,
|
| 39 |
-
"vocab_size": 49152
|
| 40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
generation_config.json
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_from_model_config": true,
|
| 3 |
-
"bos_token_id": 1,
|
| 4 |
-
"eos_token_id": 2,
|
| 5 |
-
"pad_token_id": 2,
|
| 6 |
-
"transformers_version": "5.4.0"
|
| 7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.safetensors
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:17a27dec246aec47d882c87a90908c105a2c10bdeb4d0357a2c654f0c879655e
|
| 3 |
-
size 1447317080
|
|
|
|
|
|
|
|
|
|
|
|
tokenizer.json
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"add_prefix_space": false,
|
| 3 |
-
"backend": "tokenizers",
|
| 4 |
-
"bos_token": "<|im_start|>",
|
| 5 |
-
"clean_up_tokenization_spaces": false,
|
| 6 |
-
"eos_token": "<|im_end|>",
|
| 7 |
-
"errors": "replace",
|
| 8 |
-
"extra_special_tokens": [
|
| 9 |
-
"<|im_start|>",
|
| 10 |
-
"<|im_end|>"
|
| 11 |
-
],
|
| 12 |
-
"is_local": false,
|
| 13 |
-
"model_max_length": 8192,
|
| 14 |
-
"pad_token": "<|im_end|>",
|
| 15 |
-
"tokenizer_class": "GPT2Tokenizer",
|
| 16 |
-
"unk_token": "<|endoftext|>",
|
| 17 |
-
"vocab_size": 49152
|
| 18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|