Instructions to use zed-industries/zeta-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zed-industries/zeta-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zed-industries/zeta-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zed-industries/zeta-2") model = AutoModelForCausalLM.from_pretrained("zed-industries/zeta-2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zed-industries/zeta-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zed-industries/zeta-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zed-industries/zeta-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/zed-industries/zeta-2
- SGLang
How to use zed-industries/zeta-2 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 "zed-industries/zeta-2" \ --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": "zed-industries/zeta-2", "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 "zed-industries/zeta-2" \ --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": "zed-industries/zeta-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use zed-industries/zeta-2 with Docker Model Runner:
docker model run hf.co/zed-industries/zeta-2
How to self-host?
Hello there and thank you for sharing the model!
While the model being open-weight is great, it seems to require extra knowledge to be able to benefit from it. It would be great if you'd share instructions on how to self-host the model and connect it to Zed.
Hello!
I have researched a bit about the topic. Based on (https://zed.dev/docs/ai/edit-prediction), "eager" is the default mode.
prompt_format usally defaults to "infer", this did not really work for me, it always suggested to delete code. "zeta2" as prompt_format gave me the exact experience as the usual TAB predictions.
I did the set up using ollama on Fedora 43 running one of the quantizations available in zed-industries/zeta-2 .
ollama pull hf.co/bartowski/zed-industries_zeta-2-GGUF:Q8_0
And then on Zed's settings.json just add or substitute the "edit_predictions" key with the following values.
"edit_predictions": {
"mode": "eager",
"provider": "open_ai_compatible_api",
"open_ai_compatible_api": {
"api_url": "http://localhost:11434/v1/completions",
"model": "hf.co/bartowski/zed-industries_zeta-2-GGUF:Q8_0",
"prompt_format": "zeta2",
"max_output_tokens": 64,
},
This can all be done on the settings UI too!
