Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save natritmeyer/bfc4b8673b26df8d469dfbb0000c6f79 to your computer and use it in GitHub Desktop.

Select an option

Save natritmeyer/bfc4b8673b26df8d469dfbb0000c6f79 to your computer and use it in GitHub Desktop.
Self-hosting Zeta-2.1 for Edit Prediction in the Zed text editor

Self-hosting Zeta-2.1 for Edit Prediction in the Zed text editor

Preconditions

  • Zed text editor installed
  • Ollama installed

Instructions

Install hf cli

brew install hf

Download Zeta-2.1

cd ~
hf download mradermacher/zeta-2.1-GGUF --include "*Q4_K_M.gguf" --local-dir ./zeta-model

Create the Modelfile

cd zeta-model

Create a new Modelfile with the following contents:

FROM ./zeta-2.1.Q4_K_M.gguf

# Zed sends this stop token for zeta-2.1 (V0318 format).
# NOTE: the "▁" characters are U+2581 "LOWER ONE EIGHTH BLOCK", not spaces.
PARAMETER stop "<[end▁of▁sentence]>"

# Set system parameters
PARAMETER temperature 0.2

Create the Ollama model

ollama create zeta2.1 -f Modelfile

Run the model

ollama run zeta2.1

Setup Zed

Add to Zed's settings.json:

"edit_predictions": {
  "provider": "ollama",
  "ollama": {
    "api_url": "http://localhost:11434",
    "model": "zeta2.1",
    "prompt_format": "zeta2_1",
    "max_output_tokens": 512,
  },
},
"show_edit_predictions": true,

Done

Restart zed, then test out your edit predictions. It's not quick, but it should work.

@natritmeyer

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment