Text Generation
Transformers
Safetensors
English
llama4_text
finance
financial-sentiment
sentiment-analysis
chain-of-thought
reasoning
grpo
sft
lora
finsenti
conversational
Instructions to use Ayansk11/FinSenti-MobileLLM-R1-950M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ayansk11/FinSenti-MobileLLM-R1-950M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ayansk11/FinSenti-MobileLLM-R1-950M") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ayansk11/FinSenti-MobileLLM-R1-950M") model = AutoModelForCausalLM.from_pretrained("Ayansk11/FinSenti-MobileLLM-R1-950M") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Ayansk11/FinSenti-MobileLLM-R1-950M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ayansk11/FinSenti-MobileLLM-R1-950M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ayansk11/FinSenti-MobileLLM-R1-950M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ayansk11/FinSenti-MobileLLM-R1-950M
- SGLang
How to use Ayansk11/FinSenti-MobileLLM-R1-950M 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 "Ayansk11/FinSenti-MobileLLM-R1-950M" \ --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": "Ayansk11/FinSenti-MobileLLM-R1-950M", "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 "Ayansk11/FinSenti-MobileLLM-R1-950M" \ --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": "Ayansk11/FinSenti-MobileLLM-R1-950M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Ayansk11/FinSenti-MobileLLM-R1-950M with Docker Model Runner:
docker model run hf.co/Ayansk11/FinSenti-MobileLLM-R1-950M
| { | |
| "architectures": [ | |
| "Llama4ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_chunk_size": 32768, | |
| "attention_dropout": 0.0, | |
| "attn_scale": 0.1, | |
| "attn_temperature_tuning": false, | |
| "bos_token_id": 128000, | |
| "dtype": "bfloat16", | |
| "eos_token_id": [ | |
| 128001, | |
| 128008, | |
| 128009 | |
| ], | |
| "floor_scale": 8192, | |
| "for_llm_compressor": false, | |
| "head_dim": 64, | |
| "hidden_act": "silu", | |
| "hidden_size": 1536, | |
| "initializer_range": 0.02, | |
| "interleave_moe_layer_step": 0, | |
| "intermediate_size": 8192, | |
| "intermediate_size_mlp": 6144, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 32768, | |
| "model_type": "llama4_text", | |
| "moe_layers": [], | |
| "no_rope_layers": [ | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1 | |
| ], | |
| "num_attention_heads": 24, | |
| "num_experts_per_tok": 0, | |
| "num_hidden_layers": 22, | |
| "num_key_value_heads": 6, | |
| "num_local_experts": 0, | |
| "output_router_logits": false, | |
| "pad_token_id": null, | |
| "rms_norm_eps": 1e-05, | |
| "rope_parameters": { | |
| "rope_theta": 8000000.0, | |
| "rope_type": "default" | |
| }, | |
| "router_aux_loss_coef": 0.001, | |
| "router_jitter_noise": 0.0, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.2.0", | |
| "use_cache": true, | |
| "use_qk_norm": true, | |
| "vocab_size": 128257 | |
| } | |