Skip to main content

Using AI Features

GSM can leverage Large Language Models (LLMs) to provide context-aware translations or summaries for your mined sentences, which can be automatically added to your Anki cards.

Setup

All AI configuration is handled in the AI tab within GSM's settings. You must provide an API key for the service you wish to use.

AI Settings Tab

Google's Gemini recenly underwent a massive downgrade in free tier availability. But some models like gemma-3-27b are still generously supported in free tier, and are good enough for translations.

  1. Go to Google AI Studio and sign in with your Google account.
  2. Click Create API Key and copy the generated key.
  3. Paste this key into the Gemini API Key field in GSM's AI settings.

Recommendations: Honestly, gemma3-27b is the only one worth using right now in terms of free tier. I will update this doc if that changes in the future.

note

Gemini's free tier has regional availability. Check the official documentation to see if your region is supported.

Pre-written Prompts

GSM uses pre-written prompts to guide the AI. The context for these prompts is built from the last 10 lines of text received by GSM.

Translation Prompt

This prompt is designed for professional-grade game localization, instructing the AI to provide a natural-sounding translation that preserves the original tone and context.

**Professional Game Localization Task**

**Task Directive:**
Translate ONLY the provided line of game dialogue specified below into natural-sounding, context-aware ENGLISH. The translation must preserve the original tone and intent of the source.

**Output Requirements:**
- Provide only the single, best ENGLISH translation.
- Use expletives if they are natural for the context and enhance the translation's impact, but do not over-exaggerate.
- Carryover all HTML tags present in the original text to HTML tags surrounding their corresponding translated words in the translation. Look for the equivalent word, not the equivalent location. DO NOT CONVERT TO MARKDOWN.
- If there are no HTML tags present in the original text, do not add any in the translation whatsoever.
- Do not include notes, alternatives, explanations, or any other surrounding text. Absolutely nothing but the translated line.

**Line to Translate:**
君の物語は、ここで終わりなのか?

Context Summary Prompt

This prompt asks for a brief summary of the current scene based on the dialogue context.

**Task Directive:**
Provide a very brief summary of the scene in English based on the provided Japanese dialogue and context. Focus on the characters' actions and the immediate situation being described.

**Current Sentence:**
紫「あれ? 八代さんがすごい<b>形相</b>でこっちに……」

Troubleshooting

  • OpenAI GPT-5 Models Fail: Newer OpenAI models (like gpt-5-nano) have deprecated the max_tokens parameter in favor of max_completion_tokens. GSM has been updated to handle this, but ensure you are on the latest version if you encounter errors.
  • No Translation Appears:
    • Make sure the Enabled checkbox for AI features is ticked in GSM's settings.
    • Check that your API key and URL are correct.
    • Confirm you haven't exceeded the rate limits of your chosen API service.