Adapting a Local LLM to a Specific Use Case
Adapting Local LLm to a Specific Use Case
I humbly bow to the ancient Yoruba pantheon, whom departed their bodies to hold congress in the spiritual realm, providing a binary code for humanity to hold communion with the spiritual and outer realms. Similarly, I invoke the Blessed Carlos Acutis, first Patron Saint of the new millenium, in the hope of echoing the civility, discipline, and wisdom beyond years demonstrated through his writing and regarding the relationship between human and technology.
For some time now, I have been thinking about building the ideal pair programming companion — one trained on the foundational wisdom of the Software Engineering discipline. But the more I thought about it, this idea betrays an underlying complexity that would be difficult to address in a first-time project because it requires capturing the nuanced support of an actual human interaction. This led me to to pivot to another great idea for a project that would teach me the inner workings of Large Language Models and explore areas that hold my curiosity (AI, symbolism and human experience): tune an LLM to give readings using ancient art of Tarot.
The idea I have is to use an LLM that runs locally on my hard drive, with an existing, configurable model that has been pretrained, and to run additional training from a narrower dataset with the goal of adapting it to a more specific use case. User prompts would be the same way someone might prompt a fortune teller: things like, "Whom will I marry?" or "Will I ever be rich?". The LLM assistant could be prototyped as something relatively surfaced (not too deep), more like a game of MASH than a ancient oracle. I will work in iterations to slowly build something more nuanced and meaningful.
How does one approach a project like this? Does it require building an assistant or is it more-training a model? Let’s unpack the answer from the point of view of software and machine learning architectures.
Requirements Definition (MVP)
Create an LLM-powered tarot card reader with the following traits:
-
Understands distinct meaning for each of the 78 cards found in a standard Tarot deck
-
Can be queried on specific, personal matters and provide interactive and personal readings
-
Understands symbolism and incorporates it into reasoning
-
Reads both language and imagery and incorporates both into responses
-
Chooses layout or "spread" based on context of user’s query.
-
Can give readings using the following spreads:
One-Card Spread Yes/No questions or quick insight
Three-Card Spread past, present, and future
Celtic Cross in_depth readings that cover multiple levels and aspects
Seven-Card Horseshoe Connects aspects of a problem, including hidden influences and likely outcome
Blind Spot A 4 card spread for enhancing self-awareness
Ankh For questions about causes behind trends
Relationship Spreads for questions about personal relationships_
-
Can apply the ideal reading or spread according to the user’s query
|
More About Tarot
Tarot Cards predate modern playing cards. In fact, the modern deck is derived from Tarot, or more correctly, all playing cards used to be Tarot decks. Tarot’s Minor Arcana mirrors a modern deck with 4 suits of 13 cards, except that each of the 4 tarot suits contain a total of 14 cards because there are 4 face cards instead of 3: Jack, Queen, King, and Knight. The suits themselves are a little different: Cups <--> Hearts Swords <--> Spades Pentacles <--> Diamonds Wands <--> Clubs Playing cards used to always include a Major Arcana, but these cards were usually set aside for regular game-play. The only Major Arcana card that remains in most modern decks is 0—The Fool, commonly known as the Joker. |
Three Approaches for building an LLM-powered Tarot Card Reader
#1: Orchestrated Assistant
Using an approach called LLM Orchestration or Agent Building, use an existing LLM like GPT-3, Llama 3, or Deep Seek and apply configurations for the following:
| System prompts |
Defines tarot knowledge and reading style |
| Context memory |
Database or document store retrievals |
| Custom embeddings |
Trains on tarot card meaning and interpretation according to context (e.g., nature of query, chosen layout or "spread") |
Orchestration does not train a model, but instead teaches and shapes it.
Orchestration Approach Analysis
#2: Fine-Tuning/Training Approach
Fine-tuning an existing, open-source base model (e.g., llama, deepseek, etc) means training it on additional sets of large data, like tarot card guides, deck manuals, symbolism dictionaries, transcribed, real-world readings, and description metadata from tarot image sources.
Pulling this off requires first establishing a tarot corpus[1]. This tarot corpus refers to the a customized knowledge base on which the model is fine-tuned. This is what gives the LLM the ability to provide coherent and accurate tarot card readings. The corpus is comprised of knowledge from various resources and covers a wide breadth of cultural and geographical references, crucial for understanding context, "vibe", and basis.
Fine-tuning models encompasses a couple of different approaches and a variety of techniques, and without getting too heavy into these distinctions, understand that the goal of fine-tuning is to purpose an existing model for a specific use-case. Fine-tuning can be accomplished using tools like HuggingFace or Axolotl and range from expensive to very expensive. It also requires curating massive datasets and consumes an enormous amount of energy.
Using this approach is more likely to feel like a genuine tarot AI and less like a disembodied head on the boardwalk in Coney Island or the slip of paper from the complimentary cookie in your last takeout meal at Panda Express. It would also be capable of running fully offline. Its personality would be more flexible and could be more carefully cultivated and shaped.
Not only is this approach expensive, it is time-consuming. It requires having a sophisticated ML infrastructure and implementation for cleaning data. This is also difficult to maintain as retraining would be needed continuously for improvement. In reality, it would involve a team or even a department, not a lonely but curious programmer and their pair programming AI (oh wait… we don’t have that yet).
#3: Vibe Coding
“Vibe coding” is a concept from the AI creator community that refers to aligning an AI’s tone, aesthetic, and emotional resonance rather than its factual or logical accuracy.
In practice, "vibe coding" means designing prompt archetypes and stylistic anchors, defining personality layers which adapt to user energy or inquiry, and using few-shot examples or synthetic dialogues to shape something like its “spirit.”
Role-Task-Format
You are a [role]. [Task description]. Output format: [specified format]
definition: Specified reference points provided within a prompt to guide AI output tone, voice, etc. Uses descriptions or concrete examples to produce desired style and tone of output, instead of general characterizations.
characterization: 'maintain a casual tone', or 'write professionally' anchoring description: 'write like Malcom Gladwell - story-driven, accessible and with surprising insights'
Dimensions or levels of characteristics built into a model’s response protocol as a multi-faceted personality. Like a Persona used to define use-case, but with more depth and authenticity established through addressing of multiple layers.
block-beta columns 6 a["communication"] b["emotion"] c["expertise"] d["interactional"] e["values/perspective"] f["cognitve"] g["Layers"]:6
Input-Output pair examples + new input
Input: [example 1] -> Output: [result 1] Input: [example 2] -> Output: [result 2] Now: Input: [your actual query]
Using vibe coding as an approach could capture a tarot reading well, while also allowing for a more flexible and creativity-based project, one that doesn’t require having deep pockets or plenty of free time. It is more an art than a science, and uses lots of iteration. On the downside, the base model would be at risk of experiencing "drift" from its intended vibe over time, and resource management and scalability could become an issue later as well, but only if demand were to skyrocket.
My approach will most likely borrow a little from each approach, and will be perfected using incremental iterations. I hope to keep readers informed of the progress as I continue down this path!
You can check out my project blueprint below, which includes a four-phase action plan with bullet points. This is also available online as a GitHub Iterative Project at Iterative Project.
I acknowledge the advanced age of this universe and its immensity and claim my nothingness among it. I humbly accept the task of writing about AI, while also understanding my limitation as a member of humanity. While I will certainly fall short of fully expressing myself, my intent is to share a curiosity of mine with you and to marvel and wonder at the spectre, hopefully learning along the way.