Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

quelmap
/
Lightning-4b

Text Generation
Transformers
Safetensors
English
conversational
Model card Files Files and versions
xet
Community
1

Instructions to use quelmap/Lightning-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use quelmap/Lightning-4b with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="quelmap/Lightning-4b")
    messages = [
        {"role": "user", "content": "Who are you?"},
    ]
    pipe(messages)
    # Load model directly
    from transformers import AutoModel
    model = AutoModel.from_pretrained("quelmap/Lightning-4b", dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use quelmap/Lightning-4b with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "quelmap/Lightning-4b"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "quelmap/Lightning-4b",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/quelmap/Lightning-4b
  • SGLang

    How to use quelmap/Lightning-4b 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 "quelmap/Lightning-4b" \
        --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": "quelmap/Lightning-4b",
    		"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 "quelmap/Lightning-4b" \
            --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": "quelmap/Lightning-4b",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use quelmap/Lightning-4b with Docker Model Runner:

    docker model run hf.co/quelmap/Lightning-4b
Lightning-4b
8.06 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 6 commits
shintaro-29's picture
shintaro-29
Upload preview.gif
1516e43 verified 8 months ago
  • .assets
    Upload preview.gif 8 months ago
  • .gitattributes
    1.67 kB
    Upload preview.gif 8 months ago
  • README.md
    2.59 kB
    Update README.md 8 months ago
  • added_tokens.json
    707 Bytes
    xet
    initial commit 8 months ago
  • chat_template.jinja
    4.05 kB
    initial commit 8 months ago
  • config.json
    1.6 kB
    xet
    initial commit 8 months ago
  • generation_config.json
    238 Bytes
    xet
    initial commit 8 months ago
  • merges.txt
    1.67 MB
    initial commit 8 months ago
  • model-00001-of-00002.safetensors
    4.97 GB
    xet
    initial commit 8 months ago
  • model-00002-of-00002.safetensors
    3.08 GB
    xet
    initial commit 8 months ago
  • model.safetensors.index.json
    32.9 kB
    xet
    initial commit 8 months ago
  • special_tokens_map.json
    613 Bytes
    xet
    initial commit 8 months ago
  • tokenizer.json
    11.4 MB
    xet
    initial commit 8 months ago
  • tokenizer_config.json
    5.51 kB
    xet
    initial commit 8 months ago
  • vocab.json
    2.78 MB
    xet
    initial commit 8 months ago