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.
The process flow
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-FILL