Skip to content

Fix zeta2 prompt format selection - #55338

Merged
probably-neb merged 5 commits into
zed-industries:mainfrom
probably-neb:fix-zeta2-local-prompt-format
May 8, 2026
Merged

Fix zeta2 prompt format selection#55338
probably-neb merged 5 commits into
zed-industries:mainfrom
probably-neb:fix-zeta2-local-prompt-format

Conversation

@probably-neb

Copy link
Copy Markdown
Collaborator

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #52585

Release Notes:

  • Fixed local zeta2 edit predictions using the wrong prompt format.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 30, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Apr 30, 2026
@kaytwo

kaytwo commented May 3, 2026

Copy link
Copy Markdown

This isn't going to be very helpful but - I built this fork and tested it against an unquantized zeta 2 running on VLLM and was still getting nonsense completions just as I was before this fix.

@probably-neb
probably-neb marked this pull request as draft May 5, 2026 12:40
@probably-neb

probably-neb commented May 5, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @kaytwo! Very helpful I haven't merged this because I was waiting to be at home where I could test it properly. Will investigate!
By any chance do you have the model set to zeta in your settings instead of zeta2?

@kaytwo

kaytwo commented May 5, 2026

Copy link
Copy Markdown

I've got the model set to zeta2 (trying zeta made for different gibberish edits). I'm not sure at this point whether it's an issue with Zed itself vs. the version of the model posted to huggingface. When I switch to "Zed AI" in the same buffer, I get edit suggestions that I would expect.

Here are some captures of the completion requests that are being made by zed, which look like I'd expect from the description of zeta 2. By far the most often completion suggestion I get is the "delete the whole file" version that just sends back "\n>>>>>>> UPDATED\n" as its completion, but sometimes I get one that essentially regurgitates the entire file. I can't recall having seen anything meaningful come out ever.

empty completion
POST /v1/completions HTTP/1.1
content-type: application/json
accept: */*
user-agent: Zed/1.2.0+dev.29a55cf31fd009823e6e21c62abb18eb02f66eb4 (linux; x86_64)
host: localhost:8000
content-length: 3083

{"model":"zed-industries/zeta-2","prompt":"<|file_sep|>edit history\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -5,5 +5,6 @@\n     print(\"--- Hello, World! in different languages ---\")\n     \n     \n+    \n \n \n// User accepted prediction:\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -4,8 +4,7 @@\n def print_hello_world():\n     print(\"--- Hello, World! in different languages ---\")\n     \n-    \n-    \n+\n \n \n def fizzbuzz():\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -3,6 +3,7 @@\n \n def print_hello_world():\n     print(\"--- Hello, World! in different languages ---\")\n+    print(\"English: \")\n     \n \n \n// User accepted prediction:\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -1,27 +1,1 @@\n-# hello_world.py\n \n-\n-def print_hello_world():\n-    print(\"--- Hello, World! in different languages ---\")\n-    print(\"English: \")\n-    \n-\n-\n-\n-def fizzbuzz():\n-    print(\"\\n--- FizzBuzz (1-100) ---\")\n-\n-    for number in range(1, 101):\n-        if number % 5 == 0 and number % 3 == 0:\n-            print(\"FizzBuzz\")\n-        elif number % 5 == 0:\n-            print(\"Buzz\")\n-        elif number % 3 == 0:\n-            print(\"Fizz\")\n-        else:\n-            print(number)\n-    return\n-\n-if __name__ == \"__main__\":\n-    print_hello_world()\n-    fizzbuzz()\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -1,1 +1,27 @@\n+# hello_world.py\n \n+\n+def print_hello_world():\n+    print(\"--- Hello, World! in different languages ---\")\n+    print(\"English: \n+    \n+\n+\n+\n+def fizzbuzz():\n+    print(\"\\n--- FizzBuzz (1-100) ---\")\n+\n+    for number in range(1, 101):\n+        if number % 5 == 0 and number % 3 == 0:\n+            print(\"FizzBuzz\")\n+        elif number % 5 == 0:\n+            print(\"Buzz\")\n+        elif number % 3 == 0:\n+            print(\"Fizz\")\n+        else:\n+            print(number)\n+    return\n+\n+if __name__ == \"__main__\":\n+    print_hello_world()\n+    fizzbuzz()\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -3,7 +3,8 @@\n \n def print_hello_world():\n     print(\"--- Hello, World! in different languages ---\")\n-    print(\"English: \n+    # English\n+    \n     \n \n \n<|file_sep|>leo/chapter1/hello_world.py\n<|fim_prefix|><<<<<<< CURRENT\n# hello_world.py\n\n\ndef print_hello_world():\n    print(\"--- Hello, World! in different languages ---\")\n    # English\n    <|user_cursor|>\n    \n\n\n\ndef fizzbuzz():\n    print(\"\\n--- FizzBuzz (1-100) ---\")\n\n    for number in range(1, 101):\n        if number % 5 == 0 and number % 3 == 0:\n            print(\"FizzBuzz\")\n        elif number % 5 == 0:\n            print(\"Buzz\")\n        elif number % 3 == 0:\n            print(\"Fizz\")\n        else:\n            print(number)\n    return\n\nif __name__ == \"__main__\":\n    print_hello_world()\n    fizzbuzz()\n=======\n<|fim_suffix|>\n<|fim_middle|>","max_tokens":256,"stop":[]}

HTTP/1.1 200 OK
date: Tue, 05 May 2026 17:18:49 GMT
server: uvicorn
content-length: 459
content-type: application/json

{"id":"cmpl-98a73fee1a440b54","object":"text_completion","created":1778001529,"model":"zed-industries/zeta-2","choices":[{"index":0,"text":"\n>>>>>>> UPDATED\n","logprobs":null,"finish_reason":"stop","stop_reason":null,"token_ids":null,"prompt_logprobs":null,"prompt_token_ids":null}],"service_tier":null,"system_fingerprint":null,"usage":{"prompt_tokens":1027,"total_tokens":1034,"completion_tokens":7,"prompt_tokens_details":null},"kv_transfer_params":null}
nonsense completion
POST /v1/completions HTTP/1.1
content-type: application/json
accept: */*
user-agent: Zed/1.2.0+dev.29a55cf31fd009823e6e21c62abb18eb02f66eb4 (linux; x86_64)
host: localhost:8000
content-length: 2896

{"model":"zed-industries/zeta-2","prompt":"<|file_sep|>edit history\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -5,5 +5,6 @@\n     print(\"--- Hello, World! in different languages ---\")\n     \n     \n+    \n \n \n// User accepted prediction:\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -4,8 +4,7 @@\n def print_hello_world():\n     print(\"--- Hello, World! in different languages ---\")\n     \n-    \n-    \n+\n \n \n def fizzbuzz():\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -3,6 +3,7 @@\n \n def print_hello_world():\n     print(\"--- Hello, World! in different languages ---\")\n+    print(\"English: \")\n     \n \n \n// User accepted prediction:\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -1,27 +1,1 @@\n-# hello_world.py\n \n-\n-def print_hello_world():\n-    print(\"--- Hello, World! in different languages ---\")\n-    print(\"English: \")\n-    \n-\n-\n-\n-def fizzbuzz():\n-    print(\"\\n--- FizzBuzz (1-100) ---\")\n-\n-    for number in range(1, 101):\n-        if number % 5 == 0 and number % 3 == 0:\n-            print(\"FizzBuzz\")\n-        elif number % 5 == 0:\n-            print(\"Buzz\")\n-        elif number % 3 == 0:\n-            print(\"Fizz\")\n-        else:\n-            print(number)\n-    return\n-\n-if __name__ == \"__main__\":\n-    print_hello_world()\n-    fizzbuzz()\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -1,1 +1,28 @@\n+# hello_world.py\n \n+\n+def print_hello_world():\n+    print()\n+    \n+    \n+    \n+\n+\n+\n+def fizzbuzz():\n+    print(\"\\n--- FizzBuzz (1-100) ---\")\n+\n+    for number in range(1, 101):\n+        if number % 5 == 0 and number % 3 == 0:\n+            print(\"FizzBuzz\")\n+        elif number % 5 == 0:\n+            print(\"Buzz\")\n+        elif number % 3 == 0:\n+            print(\"Fizz\")\n+        else:\n+            print(number)\n+    return\n+\n+if __name__ == \"__main__\":\n+    print_hello_world()\n+    fizzbuzz()\n--- a/leo/chapter1/hello_world.py\n+++ b/leo/chapter1/hello_world.py\n@@ -2,7 +2,7 @@\n \n \n def print_hello_world():\n-    print()\n+    print(\n     \n     \n     \n<|file_sep|>leo/chapter1/hello_world.py\n<|fim_prefix|><<<<<<< CURRENT\n# hello_world.py\n\n\ndef print_hello_world():\n    print(<|user_cursor|>\n    \n    \n    \n\n\n\ndef fizzbuzz():\n    print(\"\\n--- FizzBuzz (1-100) ---\")\n\n    for number in range(1, 101):\n        if number % 5 == 0 and number % 3 == 0:\n            print(\"FizzBuzz\")\n        elif number % 5 == 0:\n            print(\"Buzz\")\n        elif number % 3 == 0:\n            print(\"Fizz\")\n        else:\n            print(number)\n    return\n\nif __name__ == \"__main__\":\n    print_hello_world()\n    fizzbuzz()\n=======\n<|fim_suffix|>\n<|fim_middle|>","max_tokens":256,"stop":[]}

HTTP/1.1 200 OK
date: Tue, 05 May 2026 17:20:13 GMT
server: uvicorn
content-length: 969
content-type: application/json

{"id":"cmpl-96bb8b8ea5ced69a","object":"text_completion","created":1778001613,"model":"zed-industries/zeta-2","choices":[{"index":0,"text":"\n# hello_world.py\n\n\ndef print_hello_world():\n    print(\"\")\n    \n    \n\n\n\ndef fizzbuzz():\n    print(\"\\n--- FizzBuzz (1-100) ---\")\n\n    for number in range(1, 101):\n        if number % 5 == 0 and number % 3 == 0:\n            print(\"FizzBuzz\")\n        elif number % 5 == 0:\n            print(\"Buzz\")\n        elif number % 3 == 0:\n            print(\"Fizz\")\n        else:\n            print(number)\n    return\n\nif __name__ == \"__main__\":\n    print_hello_world()\n    fizzbuzz()\n>>>>>>> UPDATED\n","logprobs":null,"finish_reason":"stop","stop_reason":null,"token_ids":null,"prompt_logprobs":null,"prompt_token_ids":null}],"service_tier":null,"system_fingerprint":null,"usage":{"prompt_tokens":981,"total_tokens":1150,"completion_tokens":169,"prompt_tokens_details":null},"kv_transfer_params":null}

@probably-neb

Copy link
Copy Markdown
Collaborator Author

Hmm, finally had a chance to test, and I'm not seeing any issues. @kaytwo do you happen to have ZED_ZETA_FORMAT set in env? Do you mind sharing your settings (omitting URLS if you choose)?

@probably-neb
probably-neb force-pushed the fix-zeta2-local-prompt-format branch from a09fa16 to fc38279 Compare May 7, 2026 22:18
@probably-neb
probably-neb marked this pull request as ready for review May 7, 2026 22:18
@konradmb

konradmb commented May 7, 2026

Copy link
Copy Markdown

Works for me. Thank you!

$ env | grep ZED | wc
      0       0       0        
$ ./target/release-fast/zed
Video_2026-05-08_01-13-45.mp4

PS Do I smell Zeta 2.1 incoming with diagnostics support? 👀

@probably-neb

Copy link
Copy Markdown
Collaborator Author

Glad it works @konradmb!

@kaytwo if it's still not working, I'd appreciate if you opened an issue (and @-mentioned me for visibility). I'm going to merge this as is, but I do want to get things working for you

@probably-neb
probably-neb added this pull request to the merge queue May 8, 2026
Merged via the queue into zed-industries:main with commit 6bc4b4b May 8, 2026
31 checks passed
@probably-neb
probably-neb deleted the fix-zeta2-local-prompt-format branch May 8, 2026 13:22
@probably-neb

Copy link
Copy Markdown
Collaborator Author

/cherry-pick preview
/cherry-pick stable

@zed-zippy

zed-zippy Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

@zed-zippy

zed-zippy Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

probably-neb added a commit that referenced this pull request May 8, 2026
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.
probably-neb added a commit that referenced this pull request May 8, 2026
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.
@probably-neb

Copy link
Copy Markdown
Collaborator Author

/cherry-pick preview
/cherry-pick stable

zed-zippy Bot added a commit that referenced this pull request May 8, 2026
…56191)

Cherry-pick of #55338 to preview

----
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX

checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.

Co-authored-by: Ben Kunkle <ben@zed.dev>
zed-zippy Bot added a commit that referenced this pull request May 8, 2026
…56192)

Cherry-pick of #55338 to stable

----
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX

checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.

Co-authored-by: Ben Kunkle <ben@zed.dev>
@kaytwo

kaytwo commented May 8, 2026

Copy link
Copy Markdown

@kaytwo if it's still not working, I'd appreciate if you opened an issue (and @-mentioned me for visibility). I'm going to merge this as is, but I do want to get things working for you

Local zeta2.1 on vllm is giving me roughly the same suggestions I am getting through Zed AI - Zeta2 was still not really working, but not sure how useful it is to chase that particular issue down. Thanks for your help @probably-neb!

@probably-neb

Copy link
Copy Markdown
Collaborator Author

Glad to hear it @kaytwo!

Out of curiousity what GPU are you running it on, what's your vllm command, and what is your latency like? Trying to get a better feel for how it's running out in the wild

@kaytwo

kaytwo commented May 11, 2026

Copy link
Copy Markdown

@probably-neb:
Running on a 4090FE, using the raw BF16 so it uses quite a bit of my available VRAM. The completions come in with 0.3–1.5 seconds of latency, so totally usable. They all seemed correctly formed too, but haven't seen whether a quant will maintain the same accuracy.
uv run --with vllm vllm serve zed-industries/zeta-2.1 --gpu-memory-utilization=.85 --max-model-len=8182 --language-model-only --host 0.0.0.0

Nkr1shna pushed a commit to neozed-industries/neo-zed that referenced this pull request May 11, 2026
… to stable) (zed-industries#56192)

Cherry-pick of zed-industries#55338 to stable

----
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX

checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.

Co-authored-by: Ben Kunkle <ben@zed.dev>
Nkr1shna pushed a commit to neozed-industries/neo-zed that referenced this pull request May 13, 2026
… to stable) (zed-industries#56192)

Cherry-pick of zed-industries#55338 to stable

----
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX

checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.

Co-authored-by: Ben Kunkle <ben@zed.dev>
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI: zeta2, prompt_format does not work correctly for Ollama

4 participants