Instructions to use keyfan/grok-1-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use keyfan/grok-1-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="keyfan/grok-1-hf", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("keyfan/grok-1-hf", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use keyfan/grok-1-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "keyfan/grok-1-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "keyfan/grok-1-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/keyfan/grok-1-hf
- SGLang
How to use keyfan/grok-1-hf 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 "keyfan/grok-1-hf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "keyfan/grok-1-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "keyfan/grok-1-hf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "keyfan/grok-1-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use keyfan/grok-1-hf with Docker Model Runner:
docker model run hf.co/keyfan/grok-1-hf
[WIP] Fix float32 precision (multi-commit 6f4f3fee98ff848b483b84b692a4b03251126f470852d10f1205f6af709627e7)
#5
by keyfan - opened
Fix float32 precision
Multi commit ID: 6f4f3fee98ff848b483b84b692a4b03251126f470852d10f1205f6af709627e7
Scheduled commits:
- Upload 1 file(s) totalling 24.7G (86cab0a8dc9beabfc2590460e637cafbdde2797f98a93ba4322312101460a2db)
- Upload 1 file(s) totalling 36.0G (d4ac5d8543bedbc5445a6c493044cd61cad18d1c451aceb8b449b9acfad0b1e8)
- Upload 1 file(s) totalling 32.9G (e0a4aa6132c93847db4bc7e6002b5e6d96db3445d979d217990eb121f3c4cbf3)
- Upload 1 file(s) totalling 36.0G (561f027a0f6f9cb29148cbfb1dd0b3ce44bc0bc24e8a851af371ee2b047ec380)
- Upload 1 file(s) totalling 32.9G (ddbc6dda632fda5b2cdde9b9ca312d836f10a667212ea21b5aa56e5183c37c01)
- Upload 1 file(s) totalling 36.0G (b49f5d759e26551d43a0b79b418e92b4cc6e8583b163ef0f2237165e65a98985)
- Upload 1 file(s) totalling 32.9G (a4fa448c9aeb063bb8670105dbf23ae960b0ab8762ef4ef840ad28d7aff27ba9)
- Upload 1 file(s) totalling 36.0G (9d248a30a85ea0edd3772a7a9a717a00b1b9f75e340c6436943968f147cf3c0f)
- Upload 1 file(s) totalling 32.9G (556ff779a4abc6c952c62aa1db101b0332327927423642a708454b8776773fbf)
- Upload 1 file(s) totalling 36.0G (ab7647cfc18216f9de5214534d068ab3f5390314173e6db165f0faaef3d985fc)
- Upload 1 file(s) totalling 32.9G (44fa6b5fe2f64b32aacad72ff834c69b9881d7024af6162d36b72fe4d891a031)
- Upload 1 file(s) totalling 36.0G (ee2f3c1bfd6904056f083b28b52e9604eac74eeeb6c15d36c9bb2cd9b805fe56)
- Upload 1 file(s) totalling 32.9G (aa363dc369e6f20a0cd72da0a325cec9734ab2086d55ce41131f8d4cdda5b266)
- Upload 1 file(s) totalling 36.0G (3ce57e796a94924a8f0444fb0e21170a8dabecd56576ed3d72c0907d5fca95a7)
- Upload 1 file(s) totalling 32.9G (8508c1066f4ac614d743f559d9be854f6780e183bd2a31b98c7968204cbc7d35)
- Upload 1 file(s) totalling 36.0G (fc41da00f4b758190bda3d67c8667ffefe73cbbcb44cb3c391d7247338d99781)
- Upload 1 file(s) totalling 32.9G (63b370d5aee642b1f4f79c6531a5990df24142e16745d925e395af349681a3dc)
- Upload 1 file(s) totalling 36.0G (050691e71b83ee89a907f28f6d3665d1b55f425db608bae55785b47fea5d2997)
- Upload 1 file(s) totalling 19.7G (2b21be2c7236ccb78b9af4e66bade81430c7e2f7313acb25f2eaa0a06d29fcf9)
- Upload 7 file(s) totalling 2.5M (4c09a04f32ca15464e5e15ea4d49a9325d4e4f7f65f9368fb26e13ce383b1108)
This is a PR opened using the huggingface_hub library in the context of a multi-commit. PR can be commented as a usual PR. However, please be aware that manually updating the PR description, changing the PR status, or pushing new commits, is not recommended as it might corrupt the commit process. Learn more about multi-commits in this guide.
keyfan changed pull request status to closed