
Introduction to KoboldAI
KoboldAI is a free, open-source, browser-based AI client designed specifically for creative writing, storytelling, and roleplaying. Unlike many commercial AI writing tools that require a subscription or restrict your usage, KoboldAI puts you in control. You can run powerful language models on your own computer (locally) or connect to remote servers, all through a clean, intuitive web interface.
Whether you are a novelist looking to overcome writer’s block, a tabletop roleplayer seeking dynamic narratives, or a hobbyist experimenting with AI-generated text, KoboldAI provides the tools you need. Its standout features include Memory and World Info, which allow the AI to remember characters, locations, and plot details across long sessions. This makes it one of the best tools for creating coherent, long-form stories.
This tutorial will guide you from installation to advanced usage, ensuring you can start generating compelling stories within minutes.
Getting Started with KoboldAI
System Requirements
Before you begin, ensure your system meets the basic requirements. For local use (running models on your own computer), you will need a relatively modern GPU with at least 4GB of VRAM for small models, and 8GB or more for larger, more capable models. A CPU with 8GB of RAM is the minimum, but 16GB is recommended. If you do not have a powerful computer, you can still use KoboldAI by connecting to a remote server (Google Colab or a paid API).
Installation Options
There are two primary ways to use KoboldAI:
- Local Installation (Windows/Linux/Mac): Download the latest release from the official KoboldAI GitHub repository. For Windows, you can use the “One-Click Installer” which sets up everything automatically. Unzip the file and run play.bat (Windows) or play.sh (Linux/Mac). This will launch a command prompt that downloads a default model and opens your browser to the KoboldAI interface.
- Google Colab (No Installation): Visit the KoboldAI website (https://koboldai.org) and click the “Colab” link. This opens a Google Colab notebook. Run the first cell to connect to a GPU, then run the second cell to start KoboldAI. You will receive a public URL (usually ending in .ngrok.io or .gradio.live). Copy this URL and open it in your browser. This method is perfect for beginners or those without a powerful computer.
First Launch
Once KoboldAI is running, your browser will display the main interface. You will see a large text box (the “Input” area) and a smaller box above it (the “Output” area). On the left sidebar, you will find the Settings panel, the Memory tab, and the World Info tab. Don’t be overwhelmed—we will cover each part step by step.
Key Features of KoboldAI
1. Browser-Based Interface
KoboldAI runs entirely in your web browser, but it is not a cloud service. The interface communicates with a local server running on your machine (or a remote server). This means you get a modern, responsive UI without installing heavy desktop software. You can minimize the command prompt or Colab window—just keep it running in the background.
2. Multiple Language Model Support
KoboldAI supports a wide range of models, from small ones like GPT-Neo-125M to powerful ones like Llama 2 70B or Mythomax. You can switch models directly from the interface. For local use, models are downloaded automatically when you select them. For remote use, you can connect to APIs like OpenAI (paid) or use free models via Colab.
3. Memory and World Info
These two features are what make KoboldAI exceptional for storytelling.
- Memory: A simple text box where you write key facts the AI should always remember. For example, “The protagonist is a detective named Sarah. She lives in London.” The AI will reference this information throughout the story.
- World Info: A more advanced system. You create “entries” that contain keywords and associated text. When the AI encounters a keyword in your story, it automatically inserts the related information. For example, you can create an entry for “Castle Black” with the description “Castle Black is an ancient fortress made of black stone, guarded by the Night’s Watch.” Every time you write “Castle Black,” the AI will remember its details.
4. Advanced Text Generation Controls
KoboldAI gives you fine-grained control over how the AI generates text. The most important settings are:
- Temperature: Controls randomness. Lower values (0.2–0.5) produce more predictable, focused text. Higher values (0.8–1.2) produce more creative, chaotic text.
- Top-k Sampling: Limits the AI to choosing from the top k most likely next words. Lower values (e.g., 40) make output more conservative.
- Top-p (Nucleus) Sampling: Similar to top-k, but dynamic. A value of 0.9 means the AI considers only the smallest set of words whose cumulative probability reaches 90%.
- Repetition Penalty: Prevents the AI from repeating words or phrases. A value of 1.1 is a good starting point.
5. Save and Load Stories
You can save your entire session, including the story text, memory, and world info, as a single file. This makes it easy to return to a story days or weeks later. Simply click the Save button in the top menu, and load it later using the Load button.
How to Use KoboldAI: A Step-by-Step Guide
Step 1: Set Up Your Model
After launching KoboldAI, the first thing to do is choose a model. Click the Model tab in the left sidebar. You will see a list of available models. For beginners, the Mythomax L2 13B (if you have enough VRAM) or Pygmalion 6B are excellent choices for storytelling. Click the model name, then click Load Model. Wait for the download and loading process to complete (this may take a few minutes).
Step 2: Write a Prompt
In the large input box at the bottom, type a starting sentence or paragraph. For example: “The old man sat on the park bench, watching the children play. He clutched a faded photograph in his trembling hands.” This is your “prompt” – the seed for the AI to continue.
Step 3: Generate Text
Click the Generate button (or press Ctrl+Enter). The AI will produce a continuation of your text in the output box above. You can click Generate multiple times to extend the story. If you don’t like the output, click Retry to get a new version.
Step 4: Use Memory for Consistency
Open the Memory tab. Write a short summary of your story, characters, or setting. For example: “The old man’s name is Arthur. He lost his wife 10 years ago. The photograph is of their wedding day.” The AI will now incorporate this information into future generations. You can update the memory as the story progresses.
Step 5: Create World Info Entries
Click the World Info tab. Click Add Entry. Give your entry a name (e.g., “The Park”). Under Keys, type keywords that trigger this entry, separated by commas (e.g., “park, bench, oak tree”). Under Content, write the description the AI should use when it sees those keywords (e.g., “The park is called Willow Park. It has a large oak tree in the center and a small pond.”). Enable the entry by clicking the toggle switch. Now, whenever you write “park” in your story, the AI will remember the details you provided.
Step 6: Adjust Generation Settings
Experiment with the settings in the Settings tab. For a balanced story, try:
- Temperature: 0.7
- Top-p: 0.9
- Repetition Penalty: 1.1
- Max Length: 200 (this controls how many tokens the AI generates per click)
For more creative or unpredictable stories, increase the temperature to 1.0 or higher. For more focused, logical stories, lower it to 0.5.
Step 7: Save Your Work
Click the Save button in the top toolbar. Choose a filename and location. The file will save with a .json extension. To resume later, click Load and select the file. Your entire story, memory, and world info will be restored exactly as you left them.
Tips for Getting the Best Results
Tip 1: Write Detailed Prompts
The AI can only work with what you give it. A vague prompt like “Write a story” will produce generic results. Instead, provide context: “Write a science fiction story about a robot that discovers emotions after a solar flare damages its logic circuits.” The more specific you are, the better the output.
Tip 2: Use Memory and World Info Together
Memory is for global facts (character names, plot points). World Info is for situational details (locations, items, factions). Using both creates a rich, consistent world. For example, keep character traits in Memory, but use World Info for descriptions of each room in a haunted house.
Tip 3: Edit and Curate the Output
KoboldAI is a tool for co-creation, not a magic wand. Do not accept every generation blindly. Read the output, delete parts you don’t like, and edit the text before generating the next segment. This iterative process produces much better stories than letting the AI run on autopilot.
Tip 4: Use the “Author’s Note” Feature
In the Settings tab, you will find a field called Author’s Note. This is a short message that the AI sees at every generation step. Use it to reinforce the tone or direction. For example: “Focus on the character’s internal emotions.” or “Maintain a dark, suspenseful atmosphere.” This is more powerful than Memory for steering the style of writing.
Tip 5: Experiment with Different Models
Different models have different strengths. Mythomax is excellent for creative fiction and roleplay. Pygmalion is designed for dialogue and character interaction. Llama 2 models are good for general-purpose writing. Try several to find the one that matches your preferred style.
Tip 6: Manage Context Length
AI models have a limited “context” – the amount of text they can see at once. If your story gets very long, the AI may forget earlier parts. Use Memory and World Info to keep critical information accessible. You can also use the Trim button to remove older parts of the story while preserving the summary in Memory.
Tip 7: Use the “Soft Prompt” Feature (Advanced)
For users who want even more control, KoboldAI supports “soft prompts” – small files that bias the AI toward a particular style or genre. You can download soft prompts from the KoboldAI community or create your own. Apply them in the Soft Prompt tab.
Tip 8: Join the Community
KoboldAI has an active community on Discord and Reddit. If you run into issues, want to share your stories, or need model recommendations, these communities are invaluable. The developers also release updates and new features regularly.
Conclusion
KoboldAI is one of the most powerful and flexible AI writing tools available, especially for those who value privacy, control, and creative freedom. By following this tutorial, you have learned how to install it, set up models, use Memory and World Info for consistency, and fine-tune generation settings for your specific needs.
Remember that the key to great AI-assisted writing is collaboration. Treat KoboldAI as a creative partner that can spark ideas, overcome writer’s block, and expand your narratives in unexpected directions. With practice, you will develop a workflow that produces stories you are proud to share.
Now, open KoboldAI, write your first prompt, and let the adventure begin.