Verbose AI is a Dart-based utility that uses AI to automatically standardize, correct grammar and spelling, and rewrite casual or broken English into professionally polished text using Google's gemma-2-2b-it model via Hugging Face Inference API.
- ✅ Fixes grammar, spelling, and sentence structure
- ✅ Rewrites text in a formal, professional tone
- ✅ Uses state-of-the-art open-source LLM (Gemma 2B IT)
- ✅ Fallback mechanism if the API fails
- ✅ Easy to plug into any Dart / Flutter project
The app sends user input to the Hugging Face Chat Completions API, using Google's instruction-tuned Gemma model. The model rewrites the text professionally and returns the standardized output.
- 🧩 Model:
google/gemma-2-2b-it - 🔗 API: Hugging Face Inference Chat Completions Endpoint
- 🧰 Language: Dart
Add the following dependencies to your pubspec.yaml:
dependencies:
http: ^0.13.6- Create an account at Hugging Face.
- Generate a free API token at https://huggingface.co/settings/tokens.
- Replace the placeholder API key in
TextServicewith your own:
final String apiKey = "hf_YourTokenHere";final service = TextService();
void main() async {
String input = "how are u dongd aht bro";
String result = await service.standardizeText(input);
print(result); // Output: "How are you doing that, brother?" (Professionally rephrased)
}Endpoint:
POST https://api-inference.huggingface.co/chat/completions
Payload:
{
"model": "google/gemma-2-2b-it",
"messages": [
{"role": "system", "content": "You are a professional editor..."},
{"role": "user", "content": "raw input text"}
],
"temperature": 0.3,
"max_tokens": 150
}If the Hugging Face API fails (e.g. network error or quota exceeded), the app gracefully falls back to a basic standardization method using simple string replacements.
MIT License. Feel free to modify, use, and distribute.
Made with ❤️ by Harishri
Let me know if you want to include screenshots, a badge (e.g. Dart Pub), or convert this into a Flutter UI version too!