File size: 3,900 Bytes
6e831cf
 
e418392
6e831cf
 
 
 
 
 
e418392
6e831cf
e418392
575fbab
 
 
 
6e831cf
 
e418392
 
ad75d77
 
 
 
 
e418392
ad75d77
 
 
 
fe8a61a
735c9e9
ad75d77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e418392
 
 
 
 
 
 
 
ad75d77
e418392
a9e94e5
e418392
 
 
ad75d77
e418392
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: Cosmere Codex
emoji: 
colorFrom: yellow
colorTo: pink
sdk: gradio
sdk_version: 6.18.0
python_version: '3.13'
app_file: app.py
pinned: true
license: mit
short_description: Chat in character with the Shards of the Cosmere
tags:
  - track:wood
  - achievement:offgrid
  - achievement:offbrand
---

# ✨ Cosmere Codex — *Voices of the Shards*

A living star map of the Cosmere. Click a system and talk — **live and in
character** — with the god-like Shard who dwells there. Each Shard is performed
by a small language model kept fully in voice: ask anything, and it answers on
the fly in its own distinct character. **The AI isn't a feature here; it *is*
the experience.**

Built for the Hugging Face **Build Small Hackathon** — creative track,
"Thousand Token Wood."

## 🎬 Demo & write-up
- **Demo video + social post:** [LinkedIn submission post](https://www.linkedin.com/posts/joshua-jessee-94a069327_this-is-my-submission-for-the-huggingface-ugcPost-7472315911702753281-q3Xu/)
- I also added the video into the space, under screen recording mp4

## The idea
The Cosmere is full of god-like beings called Shards, each the embodiment of a
single intent — Ruin, Devotion, Odium, Cultivation. *Cosmere Codex* turns that
pantheon into something you can actually **converse with**. The front page is a
slowly-orbiting "solar system of systems": each world drawn as its own animated
symbol circling a central star. Click one and you drop into a themed
conversation with its Shard — Odium trying to seduce you into surrendering your
guilt, Cultivation answering only in riddles of seeds and seasons, Hoid
deflecting every question with a story.

The design bet: a small model doesn't reliably *know* Cosmere canon, so we don't
ask it to. Each Shard's personality **and** key lore live in its system prompt,
so the model simply *performs* a fully-specified character instead of inventing
facts. The result stays in-voice and on-canon while running on a tiny model.

## The tech
- **Model:** `Qwen/Qwen3-8B` (≤ 32B) in **non-thinking mode** for snappy,
  in-character replies, served with Hugging Face `transformers` on **ZeroGPU**
  (`@spaces.GPU`), streamed token-by-token via the tokenizer's chat template.
  The model id is one easy-to-swap constant in `app.py`.
- **Custom UI (Off Brand):** `gr.Blocks` pushed well past stock Gradio — a
  CSS/SVG deep-space scene; seven hand-built, animated vector system symbols
  (turning gears, orbiting planet-dots, pulsing suns) arranged in a circle that
  slowly revolves around a central star; per-Shard color theming; and a tiny
  JS click-bridge so the custom symbols drive navigation. Collapses to a clean
  tappable grid on mobile.
- **Lore-in-prompt:** characters and canon are authored in `shards.py`, separate
  from the UI, so voices are easy to tune.

## The Shards
- **Harmony** (Scadrial) — the god who was once a mortal scholar, holding stability and ruin in balance.
- **Odium** (Roshar) — divine hatred that calls itself Passion and offers freedom from guilt.
- **Cultivation** (Roshar) — the patient gardener who prunes people toward growth.
- **Devotion & Dominion** (Sel) — two Splintered Shards, finishing each other's broken thoughts.
- **Endowment** (Nalthis) — the giver of Breath, watching what mortals make of her gifts.
- **Autonomy** (Taldain) — the many-faced Shard who will never tell you who it truly is.
- **Hoid** (Drominad) — no Shard rules this system, so the Cosmere's eternal wanderer is filling in… unfortunately.



## Attribution & disclaimer
Lore facts adapted from the [Coppermind wiki](https://coppermind.net) (CC BY-NC-SA).
An **unofficial, non-commercial fan project** — not affiliated with or endorsed by
Brandon Sanderson or Dragonsteel. The Cosmere and its worlds are their creations.

Configuration reference: https://huggingface.co/docs/hub/spaces-config-reference