This is a demo. It contains no confidential data/IP.
An interactive web-based application to explore how Language Models (LLMs) predict missing words in sentences.
Users can enter a sentence, select a word to blank out, and let the chosen LLM predict the most likely word(s) to fill in.
The app also visualizes token probabilities in a structured table for deeper insights.
- Model Playground – Select from multiple OpenAI/LLM models via OpenRouter.
- Interactive Sentence Editing – Click any word in the sentence to blank it out (
____) and trigger predictions. - Top Predictions Table – View the top 20 model predictions with probability scores.
- API Key Support – Securely enter your OpenRouter API Key to authenticate.
- Responsive UI – Built with Bootstrap 5 and Bootstrap Icons for a modern, mobile-friendly experience.
LLM-FILL/
├── index.html # Main application UI (Bootstrap 5)
├── scripts.js # Core logic: tokenization, API calls, rendering
└── README.md # Project documentation
flowchart TD
A[User enters sentence] --> B[Click Process button]
B --> C[Tokenize sentence into words]
C --> D[Render interactive sentence as buttons]
D -->|User clicks token| E[Replace token with ____]
E --> F[Send modified sentence to OpenRouter API]
F --> G[Model predicts top tokens + logprobs]
G --> H[Process response JSON]
H --> I[Visualize top 20 tokens in probability table]
I --> J{User interaction}
J -->|Click another token| E
J -->|Reset blank| D
- Enter a sentence in the input box.
- Click Process to tokenize the sentence.
- Click on any token (word) to blank it out (
____). - The app sends the modified sentence to the selected LLM model via OpenRouter API.
- The model predicts the most likely token(s) to fill the blank.
- A probability table shows the top predictions with their likelihoods.
git clone https://github.com/Nitin399-maker/LLM-FILL.git
cd LLM-FILLOpen index.html directly in any modern browser — no build step or server required.
- Enter your OpenRouter API Key in the key field.
- Select an LLM model (GPT-4.1 Nano, Mini, or Full).
- Type a sentence, click Process, then click any word to see predictions.
This app uses the OpenRouter API to access OpenAI models with logprobs support. You will need a valid OpenRouter API key to use the prediction feature.
| Technology | Purpose |
|---|---|
| HTML5 / CSS3 | Structure & styling |
| JavaScript (Vanilla) | Application logic |
| Bootstrap 5 | Responsive UI components |
| Bootstrap Icons | Icon set |
| OpenRouter API | LLM inference with logprobs |
This is a demo. It contains no confidential data/IP.