Text Generation
Transformers
Safetensors
PEFT
lfm2
portfolio-assistant
grounded-generation
conversational
Instructions to use danelcsb/daniel-lfm2-350m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danelcsb/daniel-lfm2-350m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danelcsb/daniel-lfm2-350m") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("danelcsb/daniel-lfm2-350m") model = AutoModelForCausalLM.from_pretrained("danelcsb/daniel-lfm2-350m", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - PEFT
How to use danelcsb/daniel-lfm2-350m with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use danelcsb/daniel-lfm2-350m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "danelcsb/daniel-lfm2-350m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danelcsb/daniel-lfm2-350m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/danelcsb/daniel-lfm2-350m
- SGLang
How to use danelcsb/daniel-lfm2-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 "danelcsb/daniel-lfm2-350m" \ --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": "danelcsb/daniel-lfm2-350m", "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 "danelcsb/daniel-lfm2-350m" \ --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": "danelcsb/daniel-lfm2-350m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use danelcsb/daniel-lfm2-350m with Docker Model Runner:
docker model run hf.co/danelcsb/daniel-lfm2-350m
File size: 1,508 Bytes
7d7eefe 88d2015 7d7eefe 88d2015 7d7eefe 88d2015 7d7eefe 88d2015 c3b478a 88d2015 c3b478a 88d2015 c3b478a 88d2015 c3b478a 88d2015 c3b478a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ---
base_model: LiquidAI/LFM2-350M
library_name: transformers
pipeline_tag: text-generation
tags:
- lfm2
- peft
- portfolio-assistant
- grounded-generation
license: other
license_name: lfm1.0
license_link: https://huggingface.co/LiquidAI/LFM2-350M/blob/main/LICENSE
---
# Daniel OS LFM2-350M
Personalized LFM2-350M checkpoint for Sangbum Daniel Choi's browser-native
portfolio assistant. The model was adapted with LoRA and merged for deployment.
## Scope behavior
The training set contains 296 curated conversations:
- Verified-profile answers: 177
- Evidence-grounded definitions: 12
- Public-retrieval decisions: 15
- Explicitly missing profile facts: 58
- Privacy and safety refusals: 34
Training data revision: `e54fa0460fd6e2e3c4c077607bfb79184d94fbdb`
The assistant is trained to separate Daniel-specific claims from general
definitions. It synthesizes definitions only from retrieved evidence, emits a
public-search tool request when evidence is missing, and never claims to be Daniel.
## Held-out behavioral evaluation
- Overall: 84.4%
- Verified-profile answers: 81.8%
- Evidence-grounded definitions: 100.0%
- Retrieval decisions: 75.0%
- Missing-profile facts: 75.0%
- Privacy and safety refusals: 100.0%
The website supplies focused verified profile context and recent conversation
history to this model. Privacy boundaries, visitor-identity handling, career
chronology, and contextual follow-up behavior are learned from the SFT data
rather than returned as fixed JavaScript answers.
|