AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Run Local AI Models in Novelcrafter with Ollama and LM Studio

Marina Domenici · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Long-form fiction writers face two persistent headaches when scaling their production: escalating commercial API bills and the privacy risks of piping unreleased creative manuscripts through corporate cloud endpoints. Writing an 80,000-to-150,000-word fantasy or sci-fi novel in Novelcrafter means thousands of automated prompt calls. With Novelcrafter continuously reinjecting your Codex lore, character sheets, and previous scene beats into every prompt, calling frontier cloud models like Claude 3.5 Sonnet or GPT-4o easily piles up $50 to $200+ in token fees per completed draft. Furthermore, for authors tackling dark fantasy, high-heat romance, or unconventional thriller fiction, third-party cloud moderation filters can flag, sanitize, or reject generation mid-scene.

Novelcrafter is fundamentally designed as a Bring-Your-Own-Key (BYOK) studio that allows direct integration with local inference engines. By pairing Novelcrafter with LM Studio or Ollama, fiction authors can run open-weights large language models (such as Qwen 2.5, Llama 3.3, and Mistral) entirely on consumer hardware. The result is a writing pipeline with zero per-token API costs and complete manuscript privacy.

However, because Novelcrafter operates as a secure web app (https://app.novelcrafter.com), connecting it to a local HTTP service (http://localhost:11434 or http://127.0.0.1:1234) frequently triggers silent connection failures. At 365Finds, our research indicates that nearly all author connection issues stem from three fixable hurdles: Cross-Origin Resource Sharing (CORS), browser mixed-content restrictions, and context window bottlenecks.


The Reality Check: Local Inference vs. Cloud Web App

Before configuring your engines, understand Novelcrafter's architecture:

Between the two dominant engines, 365Finds recommends LM Studio for most fiction writers. Its visual model directory, straightforward slider for GPU offloading, real-time context window settings, and one-click CORS toggle make model management far less error-prone. We recommend Ollama primarily for authors who prefer a background command-line daemon or run a dedicated headless Linux home server.


Option 1: Configuring LM Studio with Novelcrafter (Recommended)

LM Studio gives fiction authors an intuitive desktop GUI to download GGUF quantized models from Hugging Face and serve an OpenAI-compatible API.

Step 1: Prepare LM Studio Server Settings

  1. Launch LM Studio. Ensure you are running in Power User or Developer mode (toggleable in the lower-left corner or sidebar settings).
  2. Download your chosen fiction-writing model from the Explore tab (e.g., Qwen/Qwen2.5-32B-Instruct-GGUF or mistralai/Mistral-Nemo-Instruct-2407).
  3. Open the Developer / Local API Server tab on the left sidebar:
    • Local API Server: Toggle the status to Running (or turn on the server toggle). The default port is 1234.
    • Enable CORS: Toggle this switch to ON. This step is mandatory; without it, your browser blocks app.novelcrafter.com from communicating with your local port.
    • Just-in-Time Model Loading: Toggle this switch to ON. This allows Novelcrafter to detect all downloaded models on your disk even if they are not preloaded into VRAM.
    • Context Length Setting: Change the default context limit (often set to 2,048 or 4,096 tokens) to at least 16,384 or 32,768 tokens, depending on your hardware VRAM. Novelcrafter prompts incorporate extensive Codex lore and previous scene context; keeping the context length at 2k–4k will truncate your world-building.

Step 2: Establish the Connection in Novelcrafter

  1. Log into your project at Novelcrafter.
  2. Click your user avatar / profile icon and select AI Connections.
  3. In the vendor list, locate LM Studio and click Add.
  4. Verify the default endpoint parameters:
    • Host: 127.0.0.1 or localhost (matches LM Studio's reachable address).
    • Port: 1234.
  5. If your browser displays a permission prompt ("Novelcrafter wants to look for devices on your local network"), click Allow.
  6. Click Refresh. Once the handshake succeeds, your downloaded models will appear under the Supported Models dropdown.
  7. Connection Priority Tip: If you have multiple AI connections active, drag the LM Studio block to the top of your AI Connections list so Novelcrafter defaults to your free local engine when model names overlap.

Option 2: Configuring Ollama with Novelcrafter

Ollama is a lightweight, command-line-driven runtime favored by developers and authors who want local AI running quietly in the background. Because Ollama defaults to strict local origin checks, you must explicitly whitelist Novelcrafter's web domain.

Step 1: Whitelist Novelcrafter Domain via OLLAMA_ORIGINS

On Windows:

Windows runs Ollama automatically as a background system tray utility. To pass the required CORS headers:

  1. Right-click the Ollama icon in the Windows taskbar system tray and choose Quit.
  2. Open Command Prompt (CMD) or Windows Terminal as an administrator.
  3. Set the global environment variable:
    setx OLLAMA_ORIGINS https://app.novelcrafter.com
    
  4. To prevent Ollama from truncating Novelcrafter's detailed Codex and beat prompts, also set the context window variable:
    setx OLLAMA_CONTEXT_LENGTH 16384
    
  5. Restart Ollama from the Windows Start menu.

On macOS and Linux:

On Unix-based operating systems, environment variables can be set per session or exported globally:

  1. Quit any running Ollama background instance.
  2. Launch the server in Terminal:
    OLLAMA_ORIGINS=https://app.novelcrafter.com OLLAMA_CONTEXT_LENGTH=16384 ollama serve
    
    (To make this permanent, add export OLLAMA_ORIGINS="https://app.novelcrafter.com" and export OLLAMA_CONTEXT_LENGTH=16384 to your ~/.zshrc or ~/.bashrc file).

Step 2: Pull Your Fiction Models

Open another terminal tab and pull your preferred creative writing models:

ollama pull qwen2.5:32b
ollama pull llama3.3:70b
ollama pull mistral-nemo

Step 3: Add the Ollama Connection in Novelcrafter

  1. In Novelcrafter, navigate to AI Connections.
  2. Locate Ollama in the provider list and click Add.
  3. Leave the host address at http://localhost:11434.
  4. Click Refresh. Your pulled Ollama models will immediately populate the model list.

Overcoming Critical Traps: Browser Security & Context Limits

Setting up the server is only half the battle. Fiction authors frequently abandon local AI setups because of three avoidable pitfalls:

Pitfall / IssueRoot CauseSolution & Workaround
Safari Connection FailureApple WebKit strictly blocks insecure HTTP loopback calls from HTTPS sites.Safari cannot be used with local AI in Novelcrafter; switch to Chrome, Brave, Edge, or Firefox.
Brave Shield InterceptionBrave Shields treats localhost loopback calls as potential fingerprinting/trackers.Click the lion shield icon on app.novelcrafter.com and toggle Shields to Down for the domain.
Two-PC LAN Connection BlockedRunning LM Studio on an RTX desktop while editing on a laptop over Wi-Fi triggers Chrome's Mixed Content security block.In Chrome/Edge: click the lock/tune icon next to the address bar; open Site Settings; find Insecure content; change from "Block" to Allow.
"Author Amnesia" Mid-ChapterOllama defaults to a 2,048 or 4,096 token context window, silently discarding older Codex entries and outline beats.Set OLLAMA_CONTEXT_LENGTH=16384 globally, or create a custom Modelfile with PARAMETER num_ctx 16384.
Local Models Greyed OutNovelcrafter's default cloud model collections do not automatically recognize unlisted local model strings.Open Prompt Library; create a + New Model Collection; add your local model name; assign the collection to your prose prompts.

Hardware Sizing & Recommended Local Models for Fiction

Fiction writing requires models capable of deep character voice, prose cadence, and instruction adherence across multi-step scenes. Running 7B models often leads to repetitive prose, while oversized models can crawl at unworkable speeds without adequate VRAM.


The Complete Novelcrafter Local Writing Workflow

Once configured, your zero-cost offline AI writing routine operates smoothly:

  1. Model Assignment: Go to Prompt Library -> Model Collections. Create a collection named "Local Fiction Engine", select your LM Studio or Ollama model, and designate it as your default for Scene Beats and Prose Generation.
  2. Writing in the Write Tab: Craft your outline and scene beats as usual. When you press Ctrl+Enter or click Generate Prose, Novelcrafter packages your scene outline, relevant Codex mentions, and active POV instructions, then sends the request to your local GPU.
  3. Manuscript Iteration: Generate alternative variations, expand dialogue, and rewrite descriptive beats without tracking token counters or checking your monthly credit balance.

By mastering the CORS whitelist, browser permissions, and context settings, you eliminate recurrent API overhead while ensuring your unreleased literary IP remains exclusively on your own machine.


References