|
1 | 1 | # Synt-E: The Protocol for Talking to AIs 🚀 |
2 | 2 |
|
3 | | -Synt-E is a "language" designed to give instructions to Artificial Intelligences (LLMs) as efficiently as possible. Instead of writing long sentences, you use short, dense commands that the AI understands better, faster, and at a lower cost. |
| 3 | +Synt-E is a protocol and a command-line tool for translating natural language into efficient machine commands, designed for interaction with local LLMs (via Ollama). Instead of writing long sentences, you use a keyboard shortcut to compile requests on the fly into a dense format that the AI understands better, faster, and at a lower cost. |
| 4 | + |
| 5 | +This project is not just an experiment, but a **Power Tool** for developers and power users who want to optimize their AI workflow, and a prototype of a **Machine-to-Machine (M2M) communication protocol**. |
4 | 6 |
|
5 | 7 | --- |
6 | 8 |
|
7 | 9 | ## 🤔 Why Does Synt-E Exist? The Problem |
8 | 10 |
|
9 | | -When we talk to an AI like ChatGPT, we use human language, which is full of words that are useless to a machine. |
| 11 | +When we talk to an AI, we use colloquial language. This is fine for a chat, but in a professional workflow or an automated system, it is: |
| 12 | +- **Slow:** The AI has to process unnecessary words. |
| 13 | +- **Expensive:** More words = more tokens to compute (or pay for). |
| 14 | +- **Ambiguous:** Human language can be misunderstood. |
10 | 15 |
|
11 | 16 | **BEFORE (Natural Language):** |
12 | | -> "Hi, could you please write me a Python script to analyze data from a CSV file?" |
13 | | -*(Too many words, too many "tokens", risk of ambiguity)* |
| 17 | +> "Hi, could you write me a Python script to analyze data from a CSV file?" |
14 | 18 |
|
15 | | -**AFTER (Synt-E):** |
| 19 | +**AFTER (Synt-E, activated with a shortcut):** |
16 | 20 | > `task:code lang:python action:analyze_data format:csv` |
17 | | -*(Few words, zero ambiguity, maximum efficiency)* |
18 | 21 |
|
19 | 22 | --- |
20 | 23 |
|
21 | | -## ✨ How Does the Magic Work? The Logic Behind Synt-E |
22 | | - |
23 | | -The secret is simple: **modern AIs have been trained on almost the entire Internet, and most of the Internet is in English.** |
| 24 | +## 🛠️ Why is it Useful in Any Software Project? |
24 | 25 |
|
25 | | -They have seen **billions of patterns** of code, terminal commands, configuration files, and technical texts in English. For them, technical English is not a language; it is their **native language**. |
| 26 | +In any development environment that integrates LLMs—whether it's a startup, a DevOps team, or an open-source project—efficiency is key. Synt-E offers concrete advantages: |
26 | 27 |
|
27 | | -- **Technical English is a highway:** Giving a command in Synt-E is like getting on the highway. The request reaches its destination quickly and smoothly. |
28 | | -- **Other languages are country roads:** The AI understands them, but it has to "translate" and "interpret" more, wasting time and resources. |
| 28 | +1. **💰 Cost Reduction (Token Saving):** A Synt-E prompt can be **up to 70% shorter** than a normal sentence, resulting in direct savings on costs and computational resources. |
| 29 | +2. **⚡ Increased Speed (Latency Reduction):** Fewer tokens to process means faster responses, which is essential for real-time applications. |
| 30 | +3. **🤖 Reliability and Testability (Fewer Bugs):** Synt-E is a standardized protocol. It makes interactions with AIs **predictable and easy to test**, reducing bugs. |
29 | 31 |
|
30 | | -### The Concrete Advantages |
31 | | -1. **💰 Token Savings (and Money):** Fewer words mean fewer "tokens" to pay for if you use a paid service. Locally, it means less load on your CPU/GPU. |
32 | | -2. **⚡ Superior Speed:** The AI doesn't have to think about how to interpret your pleasantries. It gets straight to the point, giving you an answer faster. |
33 | | -3. **✅ Better Answers:** By eliminating ambiguity, you reduce the risk of the AI misunderstanding and giving you a wrong or incomplete answer. |
34 | | - |
35 | | ---- |
| 32 | +### The Fundamental Discovery: The Right Model is Everything |
| 33 | +During testing, we discovered that super-trained "assistant" models (like `Llama 3 Instruct`) are the **worst** for this task because their instinct to "execute" the command wins over the meta-instruction to "compile". |
36 | 34 |
|
37 | | -## 💻 Try It Now on Your PC! (with Ollama) |
| 35 | +The best models are those that are more "raw" or "unfiltered," which are more obedient to a strict `SYSTEM_PROMPT`. Our winner was **`gpt-oss:20b`**. |
38 | 36 |
|
39 | | -This project includes a simple Python program that transforms your sentences in Italian (or any other language) into the Synt-E protocol, using an AI that runs **free and offline** on your computer. |
| 37 | +### System Limits: When NOT to use Synt-E |
| 38 | +Synt-E is a protocol for **compressing complexity**, not always length. |
| 39 | +- **Great for:** Long, descriptive, and complex sentences. Here, the savings are enormous. |
| 40 | +- **Useless for:** Very short sentences (1-3 words). In this case, the AI has to "invent" the context (`task:`, `topic:`), and the output may be longer than the input. |
40 | 41 |
|
41 | | -### Step 1: Prerequisites |
42 | | -1. **Python:** Make sure you have it installed. If you don't, download it from [python.org](https://python.org). |
43 | | -2. **Ollama:** Install Ollama to run AIs locally. Download it from [ollama.com](https://ollama.com). |
| 42 | +--- |
44 | 43 |
|
45 | | -### Step 2: Choose the Right Model (IMPORTANT) |
46 | | -Not all AI models are suitable for this task. |
47 | | -- **"Assistant" Models (like Llama 3.1 Instruct):** They are too "helpful." If you ask them to translate a request to write code, they will write the code instead of translating it. **They are the least suitable.** |
48 | | -- **"Raw" or "Unfiltered" Models (like GPT-OSS or Dolphin):** They are more flexible and obedient. They understand their role as a "compiler" and do not try to perform the task for you. **They are the best for this script.** |
| 44 | +## 💻 Usage Guide: Your Personal Compiler |
49 | 45 |
|
50 | | -From your list, the winner was **`gpt-oss:20b`**. |
| 46 | +This tool runs in the background, listening for a series of keyboard shortcuts to give you complete and safe control over the synthesis process. |
51 | 47 |
|
52 | | -### Step 3: Install and Run |
53 | | -1. **Download the model:** Open the terminal and run this command. |
| 48 | +### Installation |
| 49 | +1. **Install Ollama:** Download it from [ollama.com](https://ollama.com) and run it. |
| 50 | +2. **Download a Model:** Open the terminal and download the model you want to use (e.g., `gpt-oss` or `qwen3:30b`). |
54 | 51 | ```bash |
55 | 52 | ollama pull gpt-oss:20b |
56 | 53 | ``` |
57 | | - |
58 | | -2. **Install the library:** In the project folder, run this command. |
59 | | - ```bash |
60 | | - pip install ollama |
61 | | - ``` |
62 | | - |
63 | | -3. **Run the script:** Make sure Ollama is running, then run the program. |
| 54 | +3. **Install Python Libraries:** |
64 | 55 | ```bash |
65 | | - python synt_e.py |
| 56 | + pip install ollama keyboard pyperclip pywin32 psutil winsound |
66 | 57 | ``` |
67 | 58 |
|
68 | | -### Usage Examples |
69 | | -Now you can write your requests. The program will send them to your local model and return the translation in Synt-E. |
70 | | - |
71 | | -**Example 1: Technical Request** |
72 | | -> **YOU >** Write a Python script that uses Keras for sentiment analysis. |
73 | | -> |
74 | | -> **AI >** `task:write_script language:python libraries:keras model:RNN dataset:movie_reviews task:sentiment_analysis` |
75 | | - |
76 | | -**Example 2: Creative Request** |
77 | | -> **YOU >** Generate an image of a red dragon, in watercolor style. |
78 | | -> |
79 | | -> **AI >** `task:generate_image subject:red_dragon style:watercolor` |
80 | | - |
81 | | -**Example 3: Complex Request** |
82 | | -> **YOU >** Prepare a PowerPoint presentation for the quarterly meeting with the CEO on the topic of sales. |
83 | | -> |
84 | | -> **AI >** `task:create_presentation format:powerpoint event:quarterly_meeting audience:ceo topic:sales` |
85 | | - |
86 | | ---- |
87 | | - |
88 | | -## 🏗️ The Future of the Project |
89 | | -This script is just a prototype. The complete architecture of Synt-E (which we have explored) includes: |
90 | | -- A **hybrid engine** that uses fast rules for simple commands. |
91 | | -- A **security** system to block sensitive data. |
92 | | -- An **ecosystem** with extensions for editors like VS Code. |
93 | | - |
94 | | -Have fun compiling your thoughts! |
| 59 | +### Startup and Command-Line Options |
| 60 | +Start the script from the terminal. You can use different "flags" to customize its behavior. |
| 61 | + |
| 62 | +**Basic Startup:** |
| 63 | +```bash |
| 64 | +python synt_e.py |
| 65 | +(Uses default shortcuts and model) |
| 66 | +``` |
| 67 | +**Startup with a Custom Model:** |
| 68 | +```bash |
| 69 | +python synt_e.py --model="qwen3:30b-a3b-unlocked" |
| 70 | +``` |
| 71 | +**Startup with a Custom Shortcut:** |
| 72 | +```bash |
| 73 | +python synt_e.py --hotkey="ctrl+shift+x" |
| 74 | +``` |
| 75 | + |
| 76 | +**Startup in "Append" Mode (does not replace, but adds at the end):** |
| 77 | +```bash |
| 78 | +python synt_e.py --append |
| 79 | +``` |
| 80 | +You can combine as many options as you like! |
| 81 | + |
| 82 | +### Daily Workflow (Safe Method) |
| 83 | +The workflow has been designed to be 100% reliable, giving you full control. |
| 84 | +1. Start the script in a terminal and leave it open in the background. |
| 85 | +2. Go to any program (Chrome, VS Code, Notepad...). |
| 86 | +3. Select the text you want to synthesize. |
| 87 | +4. **Copy Manually:** Press `Ctrl+C`. |
| 88 | +5. **Activate Synthesis:** Press the shortcut (default: `Ctrl+Alt+S`). |
| 89 | +Your text will be instantly replaced with the Synt-E version! |
| 90 | + |
| 91 | +### All Shortcuts (Power User Features) |
| 92 | +This tool is more than just a synthesizer. It's a command suite: |
| 93 | +- **Synthesize (`Ctrl+Alt+S`):** Compiles the text you have copied. |
| 94 | +- **Undo (`Ctrl+Alt+U`):** You have 10 seconds after a synthesis to press this hotkey and restore the original text. A lifesaver! |
| 95 | +- **Interrupt AI (`Ctrl+Alt+C`):** If the AI is taking too long for a complex request, press this shortcut to cancel the operation. |
| 96 | +- **Keyboard Emergency (`Ctrl+Alt+Q`):** In the very rare case that the script locks your keyboard, this is your forced "emergency exit" that resets everything. |
| 97 | +
|
| 98 | +### Audio Feedback |
| 99 | +- **Double Beep:** Confirms that an operation (synthesis, undo) was successful. |
| 100 | +- **Single Low Beep:** Alerts you to an error (e.g., no text in the clipboard). |
| 101 | +- **Cancellation Beep:** Confirms that the AI operation has been interrupted. |
0 commit comments