Files
2026-08-15 15:19:08 +02:00

3.7 KiB

Grape Models — NLP to Terminal

A collection of T5 expert models hosted on Hugging Face focused on translating natural language into actionable terminal commands, routed by an intelligent semantic categorizer.

Live: grape.jrodriiguezg.link
Collection: huggingface.co/collections/jrodriiguezg/grape-models


Overview

Grape Models is a Mixture of Experts (MoE) NLP system that translates natural language instructions into terminal commands. It consists of four specialized expert models — each fine-tuned for a specific domain of terminal operations — and a semantic router that directs each query to the correct expert.

Architecture

User Input (Natural Language)
         │
         ▼
  ┌─────────────────┐
  │  Semantic Router │  ← minilm-l12-grape-route
  └─────────────────┘
         │
    ┌────┴────────────────────┐
    ▼        ▼        ▼       ▼
  BASH    SEARCH   DOCKER  NETWORK
  Expert  Expert   Expert  Expert
    │        │        │       │
    └────────┴────────┴───────┘
                 │
          Terminal Command

Base Foundation

All 4 expert models share the same base: Salesforce/codet5-small, enabling lightweight execution without sacrificing quality.

How it works

# NLP Pipeline Concept
def process_input(text):
    # 1. Router categorizes intent
    category = router_model.predict(text)
    
    # 2. Select specific Grape Expert
    expert = load_expert(category)
    
    # 3. Generate terminal command
    command = expert.generate(text)
    return command

Expert Models

Model Domain Description Link
Chardonnay BASH Generalist — file management, networking, system operations Model Card →
Pinot SEARCH Search & retrieval with Zero-Modification Policy (find, grep, stat) Model Card →
Malbec DOCKER Docker & docker-compose workflows Model Card →
Syrah NETWORK Network tasks — port scanning, DNS, connectivity, firewall Model Card →

Semantic Router

Model Purpose Link
minilm-l12-grape-route Traffic controller — routes input to correct expert Explore →

Training

  • Base model: Salesforce/codet5-small
  • Fine-tuning platform: Google Colab
  • Custom datasets: Each expert trained on domain-specific custom datasets
  • Notable dataset: malbec-nl2docker-es — public NL-to-Docker dataset in Spanish

Key Design Decisions

  • Zero-Modification Policy (Pinot): The search expert ignores install/delete requests entirely, focusing purely on information retrieval — a deliberate safety boundary.
  • Lightweight inference: codet5-small enables running all experts on constrained hardware without GPU requirements.
  • Modular routing: New expert domains can be added without retraining the existing models.

Support

If you find this project useful:
Support on Ko-fi

Author

Juan Raul Rodriguez Gil
jrodriiguezg.link


© 2026 Juan Raul Rodriguez Gil