Text Generation
Transformers
Safetensors
lfm3
liquid
nvfp4
modelopt
conversational
custom_code
8-bit precision
Instructions to use LiquidAI/LFM3-1.7B-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM3-1.7B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM3-1.7B-NVFP4", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM3-1.7B-NVFP4", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/LFM3-1.7B-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM3-1.7B-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM3-1.7B-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM3-1.7B-NVFP4
- SGLang
How to use LiquidAI/LFM3-1.7B-NVFP4 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 "LiquidAI/LFM3-1.7B-NVFP4" \ --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": "LiquidAI/LFM3-1.7B-NVFP4", "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 "LiquidAI/LFM3-1.7B-NVFP4" \ --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": "LiquidAI/LFM3-1.7B-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM3-1.7B-NVFP4 with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM3-1.7B-NVFP4
Download hf_quant_config.json from LiquidAI/LFM3-1.7B-NVFP4: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/LiquidAI/LFM3-1.7B-NVFP4/resolve/main/hf_quant_config.json
- Command line
-
hf download hf://LiquidAI/LFM3-1.7B-NVFP4/hf_quant_config.json
-
curl -L -o hf_quant_config.json https://huggingface.co/LiquidAI/LFM3-1.7B-NVFP4/resolve/main/hf_quant_config.json
1.06 kB
| { | |
| "producer": { | |
| "name": "modelopt", | |
| "version": "0.0.1.dev1+g4c1f81382" | |
| }, | |
| "quantization": { | |
| "quant_algo": "NVFP4", | |
| "kv_cache_quant_algo": null, | |
| "group_size": 16, | |
| "exclude_modules": [ | |
| "lm_head", | |
| "model.embed_tokens", | |
| "model.layers.0.conv*", | |
| "model.layers.1.conv*", | |
| "model.layers.10.self_attn*", | |
| "model.layers.11.conv*", | |
| "model.layers.12.self_attn*", | |
| "model.layers.13.conv*", | |
| "model.layers.14.self_attn*", | |
| "model.layers.15.conv*", | |
| "model.layers.16.self_attn*", | |
| "model.layers.17.conv*", | |
| "model.layers.18.self_attn*", | |
| "model.layers.19.conv*", | |
| "model.layers.2.self_attn*", | |
| "model.layers.20.self_attn*", | |
| "model.layers.21.conv*", | |
| "model.layers.22.self_attn*", | |
| "model.layers.23.conv*", | |
| "model.layers.3.conv*", | |
| "model.layers.4.self_attn*", | |
| "model.layers.5.conv*", | |
| "model.layers.6.self_attn*", | |
| "model.layers.7.conv*", | |
| "model.layers.8.self_attn*", | |
| "model.layers.9.conv*" | |
| ] | |
| } | |
| } | |