About This Project
The Digital Quill – An Austen AI Writing Companion
The Vision
This project set out to create a unique AI-powered writing assistant capable of generating text that mirrors the distinctive and beloved style of the celebrated author Jane Austen. The goal was to build not just the core AI, but also an engaging web interface where users could experience this literary AI firsthand, offering a glimpse into how AI can assist in creative writing with a specific voice. To ensure the tool is used as a creative exploration rather than for generating entire novels, considerations for guiding its use (like setting limits on generated text length) were part of the plan.
Technical Context & Project Scope
This project showcases a custom-fine-tuned Large Language Model (LLM). The primary objective was an experimental exploration into adapting a compact neural network architecture (approximately 1 billion parameters) for efficient inference on resource-constrained edge computing platforms, exemplified by devices like the Raspberry Pi 5. The fine-tuning process for this model was conducted within the Google Colab ecosystem, leveraging T4 GPU compute resources. To align with the project's exploratory nature and resource availability, the training was intentionally constrained to a single pass over the dataset (a single epoch). Consequently, this application serves primarily as a practical learning exercise and a proof-of-concept in custom model adaptation and deployment under such specific conditions, rather than a production-grade, extensively trained system.
The Heart of the Writer: The Austen AI Engine
The core of this project is a specialized computer program (a backend API) built with modern Python tools. This program is the "brain" that generates the Austen-style text.
At its heart is an AI model based on TinyLlama, which was specially trained (a process called fine-tuning) to learn and replicate Jane Austen's unique literary voice, including her vocabulary, sentence structure, and thematic nuances. This custom training was performed efficiently using a T4 graphics processing unit (GPU) on the Google Colab platform.
This AI engine is designed to be flexible. Users can provide a starting prompt, suggest the desired length of the generated text, and even choose different "writing assistance styles." These styles use various prompt engineering techniques—essentially, clever ways of instructing the AI—to help it produce text that is more relevant, coherent, and stylistically accurate. We've experimented with several approaches, including direct instructions and providing the AI with examples to guide its output.
To ensure it runs reliably, this AI engine is neatly packaged (using Docker) and operates on a dedicated server (`aiyodaserver`), working smoothly alongside other applications.
Making the AI Accessible: Web Service & Interface
To allow other programs (and our web interface) to communicate with the Austen AI, it's set up as a web service. A smart web traffic manager (Caddy) directs incoming internet requests: those intended for the Austen AI go to it (e.g., when the web address includes `/austen/`), while requests for an existing D&D-related program are routed appropriately.
This entire setup on the server is made accessible on the public internet through a secure connection using (Ngrok).
The User Experience: An Interactive Writing Companion
To allow people to easily interact with the Austen AI, a separate web application (the frontend) was developed. This is the part users see and use in their web browsers, currently running on your cloud workstation.
It's built using Python and the FastAPI framework, employing standard web technologies (HTML, CSS, and JavaScript) to create an interactive and visually appealing experience. Users can type their writing prompts, choose how long they want the AI's contribution to be, and select a "Writing Style" (like "Classic Elaboration," "Direct Input," or the playful "Scene Sparker").
The interface then communicates with the backend Austen AI over the internet, fetches the generated text, and displays it on the page smoothly without requiring a full page reload. Helpful features like example prompts, a "Copy to Clipboard" button, and a "Send text to prompt box" option are also included.
We are actively styling this web interface with a "Regency-era" aesthetic, using custom patterns and imagery to create an immersive atmosphere.
The Journey of Creation
This project has been a step-by-step process of building, testing, and refining. There was a good deal of experimentation involved, particularly in guiding the AI model to produce text that is not only stylistically correct but also relevant to the user's input. We tackled various technical challenges, from initial Python bugs and Docker setup issues to the nuances of prompt engineering needed to get the best out of the fine-tuned language model. Detailed logging and systematic testing were key to overcoming these hurdles.
Current Status & What's Next
The backend Austen AI is functional, and through careful prompt design, it's now generating text that captures the Austen style with improved relevance. The system also validates user inputs for robustness.
The frontend web interface provides a working and increasingly polished way for users to interact with the AI. The visual styling is actively being developed to enhance the user experience.
The immediate focus is on completing this visual styling. Future steps include further refining the AI's output consistency, completing all planned UI features, potentially adding broader usage limits for the demo, and finally, packaging and deploying the frontend application to a cloud platform like Google Cloud Run to make it easily shareable. The overall aim remains to provide an engaging demonstration of this specialized AI writing tool.