Pivot to shell-command vs LLM-prompt detection (warp style) - #10
Closed
ealmloff wants to merge 2 commits into
Closed
Pivot to shell-command vs LLM-prompt detection (warp style)#10ealmloff wants to merge 2 commits into
ealmloff wants to merge 2 commits into
Conversation
Replace the 48-class source-language head with a 2-class head (natural_language, prompt), retrain the tiny MSQ1 student from scratch on a public prompt/prose corpus, and pivot the Rust API from Language to Kind. Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Match Warp's actual auto-detection task: classify terminal input as a shell command or an AI prompt. Prompt class now uses real user prompts (oasst1, ShareGPT, no_robots) alongside Alpaca/Dolly/persona prompts; shell class uses NL2Bash one-liners and tldr-pages examples. Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete pivot of betlang's classes and data: the 48-class source-language student is replaced by a 2-class detector matching Warp's Agent Mode auto-detection task — is terminal input a shell command or a prompt for a language model? (Warp's public
input_classifiercrate does exactly this with a 17MB BERT-tiny ONNX model + heuristics; this model is ~45KB.)Model / data (new training pipeline, no Magika teacher):
scripts/build_prompt_corpus.pybuilds a ~148k-sample corpus:prompt: real user prompts from OpenAssistant oasst1 (English first turns), ShareGPT first human turns, and no_robots, plus Alpaca/Dolly instructions and awesome-chatgpt-prompts personas.shell_command: real bash one-liners from NL2Bash and tldr-pages example commands ({{placeholder}}flattened).scripts/train_prompt_student.pytrains the existingwordseq-b1024-k3-m2048-tiny-3conv-hiddenarchitecture from scratch with hard labels + label smoothing, QAT for the second half of the schedule, exporting through the existing MSQ1 serializer (head now96 -> 2).test_accuracy=0.992, recallprompt=0.989/shell_command=0.995.Rust API (
Language→Kind):src/language.rs→src/kind.rs;Detection::language()/top_languages()→kind()/top_kinds();CLASSES: 48 → 2. Runtime/tokenizer/quantized layers unchanged.tests/fixtures/{prompt,shell_command}/; example CLI tree mode reports a prompt-vs-shell breakdown; bench uses a prompt snippet.Supersedes #9 (natural-language vs prompt) after feedback to match Warp's actual task and use real-user prompt datasets.
cargo fmt --check,cargo test,cargo clippy --all-targets --all-features -- -D warnings, andRUSTDOCFLAGS="-D warnings" cargo docare green locally.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/2d01d14ba6444015ae43aac7fc183d60
Requested by: @ealmloff
Devin Review