I want to explore how AI can assist in fiction writing, especially using open-source models that allow for greater control, creativity, and long-form storytelling. With tools like LM Studio and Hugging Face, we can download powerful AI models capable of maintaining story coherence, helping authors generate complex narratives, and even unlocking new storytelling possibilities.
So, the idea is to create a structured approach to fiction writing with AI. By organizing story elements—characters, setting, mystery, and plot—into a detailed text file ("Telus file"), we can guide AI models to produce high-quality, structured narratives. The goal is not to replace authors but to empower them with AI-assisted storytelling.
Who wants to experiment with this approach? Or does anyone know of better AI tools for fiction writing? With larger context models and improving AI capabilities, we might be close to AI-assisted novels that rival human-written stories!
Subscribe to the newsletter at:
https://danielmiessler.com/subscribe
Join the UL community at:
https://danielmiessler.com/upgrade
Follow on X: https://x.com/danielmiessler
Follow on LinkedIn: https://www.linkedin.com/in/danielmiessler
Welcome to Unsupervised Learning, a security, AI and meaning focused podcast that looks at how best to thrive as humans in a post AI world. It combines original ideas, analysis, and mental models to bring not just the news, but why it matters and how to respond. All right, welcome to unsupervised learning. This is Daniel Miessler. All right. I want to talk about writing fiction using AI today. And I want to show a couple of different things that I'm thinking about this both for current use and also where I think all of this is going. So I want to start off with talking about LM studio. So LM studio is what I'm going to use for this. I'm also going to talk a little bit about how to do this in Olama, but I want to focus on LM studio because it's a little more visual. I think it's a little easier to get into. So LM studio is an app. You can just go and download it. It's like LM studio dot AI or.com. I'm not sure exactly. It doesn't really matter if you search for LM studio, you're going to find it. It's going to be the first thing you see. So you download that. I'm on a mac. I think it runs on lots of different things, but it's mostly Mac friendly, I think. All right. So you're going to download that. And what this does is it allows you to download different models. Now if we come over here to the internet we have basically um, hugging face is a place that I really, really enjoy going to get models is the place you want to be using for this type of thing, because it allows you to download and mess with lots of different models. And if we actually go to just the models directory here, look at this. Over 1 million different AI models are now available and these are all open source. You can just download and mess with these however you want. So what I did was I went and looked on Reddit and said, hey, I want to write some fiction. I want to be able to write long stories, and I want them to be high quality and blah, blah, blah. I basically said, hey, what's the best models, you know, open source models available today that you could use to write decent fiction? And they came back with a whole bunch of answers. Um, and I tried a bunch of them and we'll see them in the list a little bit later on. But so this is one I kind of settled on. Uh, we'll just go with this. There might be better ones. There might be. There's definitely worse ones. Uh, but this has got a few things that are pretty interesting. First of all, it's uncensored. So violence, uh, like romantic stuff. Um, you know, spicy stuff, essentially. Uh, any sorts of combat, things like that, that might be, um, blocked by, like a standard llama model, uh, or a standard open AI model or whatever. Well, first of all, those OpenAI, you'd be charged for it. Second of all, there's lots of lots of restrictions on them which make them potentially like. I don't think Harry Potter would pass the filters for a commercial model. So you got to think about like, that's the reason we're using open source models. Second reason is because they're free. Other than you have to have a machine that can run them. But other than that it's like producing stuff for you for free. So that's the reason we're using open source models. And they keep getting better and better and better. So this particular model is based around llama three, llama 318B in struct. And the context size is quite large. So that's what we like about this. It's quite large. In fact, the one I'm going to show you might even be larger than that might actually be like a 32,000 context or even more. And a lot of big models are 128 K contexts. But I mean, it goes even higher than that. And the reason you want a big context is so that it understands all the parts of the story. When it gets ready to create a new scene, or a new chapter, or even a new paragraph or whatever. It has to understand what has already happened in the story, for it to have what it writes actually be cohesive with that, right? So that is basically about that with the model itself. Um, and what we're going to do is I'm going to pull down a model. Actually, I already have it downloaded, uh, which is pretty easy to download these as well. That's not a thing I'm going to do a tutorial on, because it's just super simple, and all you have to do is look at a tutorial on LM studio or like it'll just guide you through it. It's no big deal. But anyway, I've got all these different models downloaded. What I do want to show you is how to configure it. Okay, so there's a few different ways to configure, um over here on the side. So down here in the bottom left let me show you this down here in the bottom left this says user, this says power user this says developer. And by the way they change. LM studio a decent amount. So like the interfaces kind of moves around. I imagine that's going to calm down soon, but it's a little bit annoying right now because I keep coming in here and like they've moved menus and stuff, but, um, either way, I like to keep it on developer or power user. And for the purpose of this video, I'm going to be on Power User. And so now what you have is this interface over here. You have the name of the chat here in case you have a lot up here at the top, you have um, let me see if I can make the size bigger. Oh yeah. Cool. All right. I'm going to make the size a little bigger just for the video. Um, you have the name of the model up here, and if you pull those down, you have the different models you can switch to. And the one I'm using here is actually, uh. Yeah. Dark idol two one, uncensored 32. Okay, cool. So that's another one. And you see all these different ones, right? They're all kind of story based because that's kind of the the route I was going down. But anyway, you can see that there. And look at this. This is really important. This right here. Context. 131 072. Okay. So what I'm going to do is I'm going to go over here to models and I'm going to look at this one. Is it this one. Yeah I think it is. And I'm going to click on here and look at this I'm going to slide this up okay. I'm going to slide this up to like whatever that. And um I'm going to say close. And yeah so that basically moved that. And now if I reload it which I already did before. So it's going to show that value. But the point is you go to models and you could change parameters of how big of a size you want to use for these different things. Right. So let's click on this one. Look at this okay. We're at 131. We can move this. We can slide it around right. So that's the whole point. And once you do that when you reload that thing it's going to be in the new configuration. So that's important. All right. So now let's get into the the basic concept here. Um And this is both a technical tutorial, but it's also me telling you what I think is about to happen with writing. Okay. Uh, so so let's get into that first. The difficulty of writing a long story is that you have so many things going on at once. Okay. You have a setting you're trying to get through. They're like, I'm going to use Harry Potter a lot. I think it's a it's a good example. So Harry Potter, you have like the school experience. You have like the orphan experience. You have like going into the school and the school is so big and there's ones and there's a sorting hat and there's just like this feeling of of adventure and magic and like the size of the castle. I think it's a castle. Is it a castle? Yeah. The size of the building or whatever. The school. It's like all that stuff is, like, really, really powerful. So the scene, the setting, the vibe. Right. That's one element. And if you do that really well, like it's memorable. Okay. Then you have characters. So you've got these different characters. You've got the orphan. You've got the smarty pants person. You've got the troublemakers, which are the brothers. And so you've got all those components of the of the characters. And if you read a book something like the Art of storytelling, which is my favorite book on fiction writing, by the way. Um, although I think might apply to nonfiction as well. But anyway, it's it's a fantastic book and it talks about character change. Okay. So if you're an author and you're thinking about your characters, you're thinking about how they start off, how they change over time and how they end up at the end, that's a huge part of the story. Okay. So now you have setting and these aren't in any particular order. By the way, if I were to say anything were most important it would probably be characters. Um, but anyway, you have characters, you have a setting, then you have plot. Okay. So you've got plot, which is like, what are the things that happen? What is the like the the ups and downs, right. Then I would say as maybe a sub piece of the plot. And by the way, I'm not putting this out as an expert sort of analysis of the components of a story. I might do a piece on that, but even then I wouldn't be an expert. I would say the expert is go read this book. It's not specifically about this breakdown of stories, but, um, I am thinking about doing a breakdown just like this. Um, just so I can have it in my own mind so I could actually put better input into the AI to do this. But, um, I would say that a component of the, um, the plot is going to be the mystery. So this is one thing that I'm going to have in all of my prompts when I go to work on this, and even when I'm writing just completely by myself and I'm not using the AI during that period, I am always going to be thinking about these things. In fact, I plan when I write my first fiction book, I'm going to have a giant whiteboard and I'm going to have these listed as layers. Okay. At the bottom I'm going to have like this deep mystery layer. Okay. So in Harry Potter, one of the very first scenes, I can't remember how early it is. One of the very first scenes is someone comes in and kills or tries to kill the baby in the crib. And a mom blocks it and the mom gets killed and the kid survives. Okay, that's one of the first things that happens that immediately starts a mystery of like, okay, why were they trying to kill the kid who blocked it? Um, well, I guess it was the mom, um, who was the one who attacked. Why did they attack? So we automatically have these questions, right? And that becomes essentially one of the main mysteries that takes you all the way through. So I like to have this going across the entire whiteboard. I want to be able to see my entire story in this one whiteboard. Right. And across the bottom is the mystery. And what I could do is I could trickle in. I could say, look at this point. This is revealed at this point, this is revealed at this point. And so I, I have a visual indicator of where I'm unlocking the different components of the mystery. Okay. Well then I add on to the top. Let's put let's say this next layer is setting. Okay. So I'm going to say in the setting okay. Reveal this about the setting. Reveal this about the setting. Reveal this next layer up I'm going to have characters okay. This character is introduced. This character is introduced. On top of that I'm going to have events. Okay. So here yeah. Someone someone's going to be introduced here. Someone's going to go through this big transition period here. Someone dies here okay. Maybe the pet dies or whatever it is. No spoilers. You might not have gotten to, uh, Harry Potter because it just came out. Just kidding. It's very old. Anyway, um, big things that happen to characters. Okay, so that's here. And what I love about this. Watch this. You're seeing these layers now you're seeing. Okay, this big character event happens here. How does that correspond with the mystery portion? How does it correspond with the setting? How does it correspond with all these other pieces. Right. So now I'm not sure how many layers it's going to end up being maybe five or so. I mean, we already have character. We already have plot, we already have mystery which might be inside a plot. Not sure. And then we have, um, yeah, I think those are kind of the main ones. Maybe it's only three, maybe it's five, maybe it's seven. I'm not sure. But it ends up being a visual so you can see how these pieces add up. Then when you're thinking in your mind, and this is the thing that always stops me from writing is like, I think about this cool thing. I'm like, oh yeah, I want to incorporate that. But how does it affect this? Or how does it affect that? I want to see it all there. That's where AI comes in okay. Because watch this. One of the things I'm really good at with AI is explaining things to AIS. So this is what is about to become an unlock for writing fiction with AI. The problem with current AIS and well, not so much current, but a year ago, two years ago definitely is. First of all, they have very small context, and two, they're not very good at writing, right? They just write the same kind of stuff over and over. It's like, you know, it uses a lot of cliches. Oh, and then they couldn't believe how much their life had changed and blah, blah blah. It's like it's just, you know, really obviously copying from, um, old stories and they're just like totally ripping it off in a very cliche and lame way. So it just wasn't very good. I mean, it was halfway decent. There's people putting out books with it, but you could totally tell it's AI that is going to be going away soon because the quality of the models, but also the context sizes and also our knowledge of how to prompt. And that's a big part of what I'm going to teach you teach you right now. So imagine this whiteboard that I just showed you or just described, that has these layers in it. Now imagine and I'm probably going to do a follow up to this video where I do an actual example of a story that I want to write, and I'm going to have all these layers. I should have done that in this one, but I actually I'm so excited about this. I just wanted to get it out there for you to give you a head start, because a lot of you who are listening are like, oh crap, I know where he's about to go. So let me tell you where I'm about to go. If you take that whiteboard that I just described and you describe it in text, okay, and you give that to an AI that has one of these, look at this very large contexts. You already start to get way better stuff. And you combine that with a really good prompt and actually good story idea, right. So here's the thing. You don't have to give it like, I don't know I don't know of a good story. I mean something sci fi I don't know, something like there's a, there's a space fight or something like then you're giving all the work to the AI and it's going to give you worse stuff. What I'm specifically targeting in this video is somebody who has amazing ideas. Somebody who knows a lot of the plot points. They know their characters decently well. They know how it ends. Or maybe they know how it begins. Or maybe they know, like key points in the middle, and they know a whole bunch of setting stuff, but they can't get it organized and they can't get it to move forward in a way that gets them excited to go and write some of their own. I'm not trying to make it so that I writes a story for you. I mean, that's one possibility as well. Um, and maybe people want to go do that and pump them out and sell them or whatever, and that's that's fine. I'm more trying to help an author who has wanted to write forever and just couldn't quite get it together, couldn't quite put the pieces together. And that's why I'm so excited about what this has the ability to do. Right. So now imagine that whiteboard. But that whiteboard is structured as a text file. Okay. You're going to have all your different characters. You're going to you're going to take all your notes from all these years you've been collecting about your characters. You're going to put it in that context file. Then you're going to take the the setting elements. Then you're going to take the deep mystery that that permeates the entire story. Then you're going to take these key events, right? You're going to describe all of that into a file. So let me let me take you over to, um, another interface that you could potentially use for this, which is Olama. It's a different tool. I actually have a whole video and blog post on how to set up a lama to do something like this. But let me show you this. This is a model file, um, which is um, it's essentially a file that tells the model how to behave. And, uh, this is pointing to an actual model file. There's a is a little bit technical, but it doesn't matter. What I'm actually showing you here right now. Is this system prompt okay. System prompt is what tells the model how to behave. It's not giving it instructions really, of what to write specifically. But when it does do its instructions, what rules does it follow to carry out those instructions? That's what a system prompt does. So look at this. You are an expert fiction writing service that understands how to write complex, intricate, detailed stories given input from an author. Okay, they give you setting character ideas, plot points, setting ideas. Said that twice. Key drama points, key ideas that need to get expressed, key character transformations, and maybe key points like start ending, whatever. Take all of that. Think for four hours. This is kind of a little prompt trick. I'm not sure how much it works. Um, it doesn't really matter. Think about the full arc of the story over ten 2000 page books. So this is the type of prompt that's going to work better and better. The better the models get, the smarter the AI gets, right? So right now, maybe this is halfway decent. Maybe in two months a new model is going to come out. It's just absolutely insane. For example, I'm going to give this to O1, which is the new model out of OpenAI, and I'm going to give it a prompt, which I'm going to show you. Actually, that has tons of detail about a story I actually want to write. And what that thing is able to do, it's able to deeply think about all the different pieces of instruction that you gave it in the prompt. Right. So I think we're going to get way better results from that. I'll let you know in a future video. Anyway, current models can already do this fairly well. Then I'm going to tell it how exactly I want you to write. And ideally you would give it your own writing style that you really like, and you would tell it to model after that. In this case, I'm just giving an example I like clean writing descriptive. Also, I want it in first person. Not a lot of third party narration. Don't use cliches. Write every scene realizing the overall story arc that you've constructed. And don't add the context directly into the text, but refer to it indirectly, in other words. Yeah, just just be. Show. Don't tell. Essentially. So, um, and then write the scene or chapter or the story that you were asked for. Okay. So watch that. Um, so now if I go, like, and I run this one and this is the Lama version, this is a text version. We're going to do the exact same thing back in the other interface. And I go up, look at this, write a scene about a story in a young about a young couple in love in 2023 when I is become asi superintelligence. And, um, they've people are uploading their brains into the hive, waiting for transfer to await body transfer. So they're going to get new bodies. The main character, her name is Ari. She's in love with her boyfriend, but he doesn't want to upload. She uploads and he doesn't. And they meet in the scene later on. Um, and the scene is basically like, she's at some very nice event because she's now super, you know, super smart and super awesome and powerful and super attractive. And she's at this private exclusive event, and her old boyfriend is one of the people serving the food. And he serves her a glass of wine and he, like, notices it's her. Or at least it looks like her. But she's just unbelievably gorgeous. And the staff has already told him not to ever speak to anyone here because that's like, disrespectful. And there's like this big hierarchy and everything. She realizes it's him and like, she's been thinking about him anyway, but now she's like, she realizes she still loves him. Whatever. So this is the instruction that we're giving to the AI. So I'm going to press enter. So this looks a little low end right. Trashy. Um I do want to tell you millions of these books are sold all the time. And a lot of I mean, it's actually fiction. The point is, it's actually writing according to my instructions. It's writing according to the system instruction. It's writing according to the scene that I laid out in the user instruction that I just sent it, um, for a moment, in that crowded garden, surrounded by thrumming heartbeat of the party like, yeah, is it great? Uh, maybe. Maybe not. It depends what you like, right? The point is, it's actually real. It's actually following my instructions. So, um, I'm going to I'm going to just add to this, uh, write another scene where the boy is lying in bed, bed, looking at the application for upload, thinking about doing the process he dreads so he can be with her. So it switches to. I lay on my back because I told it to follow the first person, right? So it kind of followed the instruction, right? So what I'm going to do is I'm going to go do the same thing. I'm going to grab actually this stuff here, and I'm going to copy that, and we're going to switch back over here. And I'm going to put this in the system prompt. And then I'm going to go and I'm going to run this again, and I'm going to grab this. And I'm going to put that in the chat here okay. And it's got a bunch of garbage in here. No big deal. I'm going to hit send. Look at this. Look at this. This is actually much better. It's the same model actually. But this one just feels way better. Maybe just because the text looks better. But look at this. I mean, I'm not sure I would read this. It's just not my genre, but it's following the instructions, right? It's following the instructions. So these are the instructions. I haven't even done the full breakout of the whiteboard with a full like, very clear text file with tons of detail in there. So I'm just going to leave this up and I'm going to talk through this for you. Um, this is a oh, look at this context is 1.2% full. That is that's a new feature. I like that a lot. So we have these larger context models. Okay I want you to describe that. You write a ten page very clear text file describing every character in detail, describing everything that you have in terms of like, there's this big event that happens three quarters of the way through. There's another one that happens one quarter of the way through. This is the big conflict that happens. This is the description of the bad guy. And the bad guy used to be their best friend and blah, blah, blah. All this stuff, plus all the setting stuff, plus the mystery that everyone needs to be solving the whole time through. Oh, and maybe there's a big reveal at the end, and it turns out she actually made two copies of her mind and actually got two different bodies. And there's one that's like, super aggressive and crazy and like, um, sexual or whatever. And then there's like this other one that's like super nice and it's like a nice version and maybe like, he's in love with both of them and he's got to choose. Maybe there's vampires and werewolves, whatever. Some Twilight stuff. You get the point, right? Whatever it is you want to write, whether it's high fiction and, like, the best thing ever, or it's just like you want to pump out some novels, you want to make some money. Here's here's what I'm telling you and I want you to pay attention to. We are about to have a situation where you could put that in ten pages of content describing the characters, describing scenes, describing, you know, vibes that you want to give to the reader and blah, blah, blah, blah, and basically have tons of detail in there, um, across all these different layers. Right? The characters, the setting, the The mystery, the plot, the changes in the characters, all of that. And with I'm telling you, within a few months, up to a few years. I mean, it's just going to get better and better already. Starting now, you are going to be able to make anyone is going to be able to make a full novel, a full novel. I'm talking about multiple books. I'm talking about clean chapters that transition and have the context that maintain it all the way through. We are not that far away from someone being able to write entire scripts, entire manuscripts, and most importantly for this video, entire novels and series of novels. Okay. A lot of the stuff that I'm reading right now, I'm reading some lit RPG stuff and a lot of that stuff, it's actually just one story, like I'm on book 12, but book 11 ended at one paragraph, in book 12 started at the next paragraph. And it was honestly just a perfect continuation. There wasn't like wasn't like a closing of that story. And then you go to the next one. No, it's just one long thing. And I is really good at doing that. I mean, it's just going to make a giant, you know, 500 000 word thing and maybe that's five books, maybe that's ten books, whatever it is, you know, a million words. It could be a giant archive of sets of series or whatever. Then you could just be like, okay, make a spin off that takes like Taj's story and does a whole spin off on that and give it another ten pages of detail on how that spin off is going to look. And boom, you just launched a whole nother series using your same exact idea. This is extremely close to happening, and I'm telling you right now, you could just take what I've shown you in this video and you could already make massive progress. Look at some of these models. Okay, this one I don't think I ever got to work. I think that one was broken. But like you've got. Oh, that one was broken too. I think they're actually the same. Any one of these already works. Okay. You need some halfway decent hardware, like the better. Um, I'm on a mac with a decent hardware, so it's pretty good at it, but, um. Yeah, if you use an AI machine, if you use a decent Mac, like you're going to be able to do lots of stuff with this for the store you already have using the models we already have. And then here's the thing. That ten page, okay, just just do this for me. Make sure you get your story idea fully into one of these, uh, files. And by the way, I call these Telos files for for a different reason. But let's say this is a telos file for writing a book. So, um, take your book idea, have the different layers described in extreme detail and fill it out three pages, five pages, ten pages, 20 pages. However much detail you have, take all your notes, transcribe them into this thing now, and here's what's cool about it. Once you have that thing, you can also go back in there and you can update and be like, oh, actually, this is going to happen with the with the world, and the two worlds are going to meet. And actually, this planet fights this planet, and she falls in love with this thing and all those different pieces. You could just add to that and keep it updated or whatever. Here's what's awesome. When that next model drops and it's like, hey, we just expanded. It's no longer 500,000 things of context. It's now a million things of context. And actually, it's four times better at maintaining cohesive vibes throughout a story. Oh, and also the new Mac came out. You get your new Mac or whatever, and now it's like faster or whatever. Or maybe the the, the new model requires that you have more hardware. Doesn't matter. The point is, all these upgrades are going to be happening in our in our AI enabled hardware. The model, intelligence and understanding of how to write, and the ability to match your actual writing style that's going to improve the context links is going to improve, so we can see your entire story and keep that in its memory as it writes scenes and chapters in entire books. And I'm telling you, here's my prediction. I'm going to say it again. You will very soon. I mean, you could already do this now. You could already do this now, and it will produce something halfway decent. You might actually be pretty happy with it. It depends on the level that you need. Right? If you need just a level to pump out books on Amazon, you could already do it now just using the stuff I just told you. Okay. What I'm saying is very soon, within the next few months, next couple of years, you are going to be able to produce a super, super high quality, complete novel, very long novel that follows your instructions and adds creativity and basically produces stuff that could be on a bestseller list, like on par with Harry Potter and a lot of these other stories that are human written. So that's what I wanted to cover. I wanted to show you a couple of different tools for using it. One is llama again? There's a video out there that I have, and a blog post about how to use llama to do this exact thing, but this one is mostly focused on LM studio. But most importantly, the concept of explaining your story to the AI in as much detail as possible and as the improvements happen to the models and context sizes and hardware, it's just going to get better and better. So see you next time! Unsupervised learning is produced and edited by Daniel Miessler on a Neumann U87 AI microphone using Hindenburg. Intro and outro music is by zombie with a Y. And to get the text and links from this episode, sign up for the newsletter version of the show at daniel.com/newsletter. We'll see you next time.