Text Generation
Transformers
Safetensors
laguna
laguna-s-2.1
vllm
quantized
rfa
4-bit precision
conversational
custom_code
8-bit precision
Instructions to use tcclaviger/Laguna-S-2.1-RFA_L with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tcclaviger/Laguna-S-2.1-RFA_L with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tcclaviger/Laguna-S-2.1-RFA_L", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tcclaviger/Laguna-S-2.1-RFA_L", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("tcclaviger/Laguna-S-2.1-RFA_L", trust_remote_code=True, 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tcclaviger/Laguna-S-2.1-RFA_L with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tcclaviger/Laguna-S-2.1-RFA_L" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tcclaviger/Laguna-S-2.1-RFA_L", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tcclaviger/Laguna-S-2.1-RFA_L
- SGLang
How to use tcclaviger/Laguna-S-2.1-RFA_L 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 "tcclaviger/Laguna-S-2.1-RFA_L" \ --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": "tcclaviger/Laguna-S-2.1-RFA_L", "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 "tcclaviger/Laguna-S-2.1-RFA_L" \ --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": "tcclaviger/Laguna-S-2.1-RFA_L", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tcclaviger/Laguna-S-2.1-RFA_L with Docker Model Runner:
docker model run hf.co/tcclaviger/Laguna-S-2.1-RFA_L
| { | |
| "added_tokens_decoder": { | |
| "0": { | |
| "content": "〈|UNK|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "1": { | |
| "content": "〈|CODE_START|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "2": { | |
| "content": "〈|EOS|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "3": { | |
| "content": "〈|CODE_END|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "4": { | |
| "content": "〈|META_START|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "5": { | |
| "content": "〈|META_END|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "6": { | |
| "content": "〈|FIM_MIDDLE|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "7": { | |
| "content": "〈|FIM_SUFFIX|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "8": { | |
| "content": "〈|SEP|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "9": { | |
| "content": "〈|PAD|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "10": { | |
| "content": "〈|CLS|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "11": { | |
| "content": "〈|FIM_START|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "12": { | |
| "content": "〈|MASK|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "13": { | |
| "content": "|◊|", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "14": { | |
| "content": "〈|", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "15": { | |
| "content": "|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "16": { | |
| "content": "〈|/", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "17": { | |
| "content": "/|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "20": { | |
| "content": "〈|SPECIAL_1|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "21": { | |
| "content": "〈|SPECIAL_2|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "22": { | |
| "content": "〈|SPECIAL_3|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "27": { | |
| "content": "〈|SPECIAL_8|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "28": { | |
| "content": "〈|SPECIAL_9|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "29": { | |
| "content": "〈|SPECIAL_10|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "30": { | |
| "content": "〈|SPECIAL_11|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "31": { | |
| "content": "〈|SPECIAL_12|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "32": { | |
| "content": "〈|SPECIAL_13|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "33": { | |
| "content": "〈|SPECIAL_14|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "34": { | |
| "content": "〈|SPECIAL_15|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "35": { | |
| "content": "〈|SPECIAL_16|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "36": { | |
| "content": "〈|SPECIAL_17|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "37": { | |
| "content": "〈|SPECIAL_18|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "38": { | |
| "content": "〈|SPECIAL_19|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "39": { | |
| "content": "〈|SPECIAL_20|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "40": { | |
| "content": "〈|SPECIAL_21|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "41": { | |
| "content": "〈|SPECIAL_22|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "42": { | |
| "content": "〈|SPECIAL_23|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "43": { | |
| "content": "〈|SPECIAL_24|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "44": { | |
| "content": "〈|SPECIAL_25|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "45": { | |
| "content": "〈|SPECIAL_26|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "46": { | |
| "content": "〈|SPECIAL_27|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "47": { | |
| "content": "〈|SPECIAL_28|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "48": { | |
| "content": "〈|SPECIAL_29|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "49": { | |
| "content": "〈|SPECIAL_30|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "50": { | |
| "content": "〈|SPECIAL_31|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "51": { | |
| "content": "〈|SPECIAL_32|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "52": { | |
| "content": "〈|SPECIAL_33|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "53": { | |
| "content": "〈|SPECIAL_34|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "54": { | |
| "content": "〈|SPECIAL_35|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "55": { | |
| "content": "〈|SPECIAL_36|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "56": { | |
| "content": "〈|SPECIAL_37|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "57": { | |
| "content": "〈|SPECIAL_38|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "58": { | |
| "content": "〈|SPECIAL_39|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "59": { | |
| "content": "〈|SPECIAL_40|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "60": { | |
| "content": "〈|SPECIAL_41|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "61": { | |
| "content": "〈|SPECIAL_42|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "62": { | |
| "content": "〈|SPECIAL_43|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "63": { | |
| "content": "〈|SPECIAL_44|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "64": { | |
| "content": "〈|SPECIAL_45|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "65": { | |
| "content": "〈|SPECIAL_46|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "66": { | |
| "content": "〈|SPECIAL_47|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "67": { | |
| "content": "〈|SPECIAL_48|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "68": { | |
| "content": "〈|SPECIAL_49|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "69": { | |
| "content": "〈|SPECIAL_50|〉", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "18": { | |
| "content": "<think>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": false | |
| }, | |
| "19": { | |
| "content": "</think>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": false | |
| }, | |
| "23": { | |
| "content": "<assistant>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": false | |
| }, | |
| "24": { | |
| "content": "</assistant>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| "25": { | |
| "content": "<tool_call>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": false | |
| }, | |
| "26": { | |
| "content": "</tool_call>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": false | |
| } | |
| }, | |
| "bos_token": "〈|EOS|〉", | |
| "clean_up_tokenization_spaces": false, | |
| "cls_token": "〈|CLS|〉", | |
| "eos_token": "〈|EOS|〉", | |
| "extra_special_tokens": {}, | |
| "mask_token": "〈|MASK|〉", | |
| "model_max_length": 1000000000000000019884624838656, | |
| "pad_token": "〈|PAD|〉", | |
| "sep_token": "〈|SEP|〉", | |
| "tokenizer_class": "PreTrainedTokenizerFast", | |
| "unk_token": "〈|UNK|〉", | |
| "chat_template": "{#- Iteration on laguna_glm_thinking_v8/chat_template.jinja -#}\n{#- No formatting instructions -#}\n{{- \"〈|EOS|〉\" -}}\n{%- set enable_thinking = enable_thinking | default(true) -%}\n{%- set add_generation_prompt = add_generation_prompt | default(false) -%}\n{%- set preserve_thinking = preserve_thinking | default(false) -%}\n\n{#- ───── header (system message) ───── -#}\n{#- A caller-supplied system message with empty content opts out of the default below, producing no <system> block — used to train without a system message. -#}\n{%- set system_message = \"You are a helpful, conversationally-fluent assistant made by Poolside. You are here to be helpful to users through natural language conversations.\" -%}\n{%- if messages and messages[0].role == \"system\" -%}\n {%- set system_message = messages[0].content -%}\n {%- set messages = messages[1:] -%}\n{%- endif -%}\n\n{%- set has_sys = system_message and system_message.strip() -%}\n{%- if has_sys or tools or enable_thinking -%}\n {{- \"<system>\" -}}\n\n {%- if has_sys -%}\n {{- system_message.rstrip() -}}\n {%- if tools -%}{{- \"\\n\\n\" -}}{%- endif -%}\n {%- endif -%}\n\n {%- if tools -%}\n {{- \"### Tools\\n\\n\" -}}\n {{- \"You may call functions to assist with the user query.\\n\" -}}\n {{- \"All available function signatures are listed below:\\n\" -}}\n {{- \"<available_tools>\\n\" -}}\n {%- for tool in tools -%}\n {{- (tool | tojson) ~ \"\\n\" -}}\n {%- endfor -%}\n {{- \"</available_tools>\" -}}\n {%- endif -%}\n\n {{- \"</system>\\n\" -}}\n{%- endif -%}\n\n{#- ───── main loop ───── -#}\n{%- for message in messages -%}\n {%- set content = message.content if message.content is string else \"\" -%}\n {%- if message.role == \"user\" -%}\n {{- \"<user>\" + content + \"</user>\\n\" -}}\n {%- elif message.role == \"assistant\" -%}\n {%- generation -%}\n {{- \"<assistant>\" -}}\n {#- Extract reasoning content from message.reasoning (vLLM field name) or message.reasoning_content -#}\n {%- set reasoning_content = '' -%}\n {%- if message.reasoning is string -%}\n {%- set reasoning_content = message.reasoning -%}\n {%- elif message.reasoning_content is string -%}\n {%- set reasoning_content = message.reasoning_content -%}\n {%- endif -%}\n {#- Display reasoning content for all messages if enable_thinking -#}\n {%- if enable_thinking or preserve_thinking -%}\n {{- '<think>' + reasoning_content + '</think>' -}}\n {%- else -%}\n {{- '</think>' -}}\n {%- endif -%}\n {#- Display main content (trailing newline only when no tool_calls follow) -#}\n {%- if content -%}\n {{- content -}}\n {%- endif -%}\n {%- if message.tool_calls -%}\n {%- for tool_call in message.tool_calls -%}\n {%- set function_data = tool_call.function -%}\n {{- '<tool_call>' + function_data.name -}}\n {%- set _args = function_data.arguments -%}\n {%- for k, v in _args.items() -%}\n {{- \"<arg_key>\" ~ k ~ \"</arg_key>\" -}}\n {{- \"<arg_value>\" -}}{{- v | tojson(ensure_ascii=False) if v is not string else v -}}{{- \"</arg_value>\" -}}\n {%- endfor -%}\n {{- \"</tool_call>\" -}}\n {%- endfor -%}\n {%- endif -%}\n {{- \"</assistant>\\n\" -}}\n {%- endgeneration -%}\n {%- elif message.role == \"tool\" -%}\n {{- \"<tool_response>\" + content + \"</tool_response>\\n\" -}}\n {%- elif message.role == \"system\" -%}\n {#- Render additional system messages (the first one, if any, is handled separately in the header and was sliced off above) -#}\n {{- \"<system>\" + content + \"</system>\\n\" -}}\n {%- endif -%}\n{%- endfor -%}\n{#- ───── generation prompt ───── -#}\n{%- if add_generation_prompt -%}\n {{- \"<assistant>\" -}}\n {#- ───── Include reasoning mode directive ───── -#}\n {%- if enable_thinking -%}\n {{- '<think>' -}}\n {%- else -%}\n {{- '</think>' -}}\n {%- endif -%}\n{%- endif -%}" | |
| } |