Instructions to use Web4/LS-W4-270M-Micro-T1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Web4/LS-W4-270M-Micro-T1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Web4/LS-W4-270M-Micro-T1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Web4/LS-W4-270M-Micro-T1") model = AutoModelForCausalLM.from_pretrained("Web4/LS-W4-270M-Micro-T1") 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 Web4/LS-W4-270M-Micro-T1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Web4/LS-W4-270M-Micro-T1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Web4/LS-W4-270M-Micro-T1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Web4/LS-W4-270M-Micro-T1
- SGLang
How to use Web4/LS-W4-270M-Micro-T1 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 "Web4/LS-W4-270M-Micro-T1" \ --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": "Web4/LS-W4-270M-Micro-T1", "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 "Web4/LS-W4-270M-Micro-T1" \ --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": "Web4/LS-W4-270M-Micro-T1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Web4/LS-W4-270M-Micro-T1 with Docker Model Runner:
docker model run hf.co/Web4/LS-W4-270M-Micro-T1
LS-W4-270M-Micro-T1
Model Description
LS-W4-270M-Micro-T1 is the first model in the Web4 Localized Services (W4-LS) series, specifically designed for highly efficient, on-device text generation. As a Micro Language Model (Micro-LM), it features a compact architecture with a total of $2 \times 270$ million parameters.
This model is a Masked Language Model (MLM) specialized in generating social media captions. It prioritizes inference speed and minimal resource usage, making it ideal for client-side execution.
Key Features π
- Base Architecture: Built on top of Gemma 3 270M.
- Micro-LM Architecture: Optimized for low-latency performance on consumer devices.
- Social Media Specialization: Trained to generate engaging and contextually relevant social media captions.
- Serverless Operation: A core innovation of this model is its ability to run entirely locally within a web browser or on a client device without requiring a server. This ensures full privacy and offline functionality.
How to Use: Serverless Deployment
The model is designed exclusively for serverless environments and cannot be executed using traditional Hugging Face inference endpoints.
Client-Side/On-Device Deployment Files
To run this model locally in a browser or on a device, the necessary client-side deployment files are required.
The required .task and .tflite files for local deployment can be downloaded at:
Model Details
Model Name: LS-W4-270M-Micro-T1
Model Type: Masked Language Model (MLM)
Parameters: 540 Million (2Γ270 Million)
Base Model: Gemma 3 270M
Primary Task: Social Media Caption Generation (Serverless/Local Inference)
License: Same license as the base model Gemma 3 270M
Training Details π οΈ
The model was fine-tuned specifically for the task of social media caption generation.
Training Data Size: Over 50,000 datasets (examples/entries) were used for fine-tuning.
Training Hardware: Fine-tuning was performed on a T4 GPU with 12 GB of RAM.
- Downloads last month
- -
# Gated model: Login with a HF token with gated access permission hf auth login