File size: 9,743 Bytes
00922a6
 
 
 
 
 
 
 
 
 
 
 
 
8e0ae84
00922a6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43a4e96
 
 
 
8840a34
b273f11
 
00922a6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d595314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00922a6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d595314
 
 
 
 
 
 
00922a6
d595314
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import os

ARENA_NAME = "# ๐Ÿ† The GPU-Poor LLM Gladiator Arena ๐Ÿ†"
ARENA_DESCRIPTION = """
                Step right up to the arena where frugal meets fabulous in the world of AI! 
                Watch as our compact contenders (maxing out at 9B parameters) duke it out in a battle of wits and words.
    
                Why this quirky quest? We're champions of privacy and penny-pinching โ€“ shunning pricey commercial APIs 
                and keeping our data close to our chests. Who says you need deep pockets or big tech to have big fun?
                
                Your mission, should you choose to accept it: Pit two mystery models against each other and decide 
                which pint-sized powerhouse reigns supreme in the land of lean, language models!

                More info: [README.md](https://huggingface.co/spaces/k-mktr/gpu-poor-llm-arena/blob/main/README.md)
                """ 

# Ollama API configuration
API_URL = os.environ.get("API_URL")
API_KEY = os.environ.get("API_KEY")
HEADERS = {
    "Content-Type": "application/json",
    "X-API-Key": API_KEY
}

NEXTCLOUD_URL = os.environ.get("NEXTCLOUD_URL")
NEXTCLOUD_USERNAME = os.environ.get("NEXTCLOUD_USERNAME")
NEXTCLOUD_PASSWORD = os.environ.get("NEXTCLOUD_PASSWORD")
NEXTCLOUD_LEADERBOARD_PATH = os.environ.get("NEXTCLOUD_LEADERBOARD_PATH")


# Predefined list of approved models with human-readable names
APPROVED_MODELS = [
    ("llama3.2:1b-instruct-q8_0", "LLaMA 3.2 (1B, 8-bit)"),
    ("llama3.2:3b-instruct-q4_K_M", "LLaMA 3.2 (3B, 4-bit)"),
    ("llama3.1:8b-instruct-q4_0", "LLaMA 3.1 (8B, 4-bit)"),
    ("gemma2:2b-instruct-q4_0", "Gemma 2 (2B, 4-bit)"),
    ("gemma2:9b-instruct-q4_0", "Gemma 2 (9B, 4-bit)"),
    ("qwen2.5:0.5b-instruct-q8_0", "Qwen 2.5 (0.5B, 8-bit)"),
    ("qwen2.5:1.5b-instruct-q8_0", "Qwen 2.5 (1.5B, 8-bit)"),
    ("qwen2.5:3b-instruct-q4_K_M", "Qwen 2.5 (3B, 4-bit)"),
    ("qwen2.5:7b-instruct-q4_K_M", "Qwen 2.5 (7B, 4-bit)"),
    ("phi3.5:3.8b-mini-instruct-q4_0", "Phi 3.5 (3.8B, 4-bit)"),
    ("mistral:7b-instruct-v0.3-q4_0", "Mistral 0.3 (7B, 4-bit)"),
    ("hermes3:8b-llama3.1-q4_0", "Hermes 3 (8B, 4-bit)"),
    ("aya:8b-23-q4_0", "Aya 23 (8B, 4-bit)"),
    ("granite3-dense:2b-instruct-q8_0", "Granite 3 Dense (2B, 8-bit)"),
    ("granite3-dense:8b-instruct-q4_K_M", "Granite 3 Dense (8B, 4-bit)"),
    ("granite3-moe:1b-instruct-q8_0", "Granite 3 MoE (1B, 8-bit)"),
    ("granite3-moe:3b-instruct-q4_K_M", "Granite 3 MoE (3B, 4-bit)"),
    ("ministral-8B-instruct-2410", "Ministral (8B, 4-bit)"),
    ("dolphin2.9.4-llama3.1", "Dolphin 2.9.4 (8B, 4-bit)"),
]

# Example prompts
example_prompts = [
    "Explain how the internet works to someone from the 1800s.",
    "Design a new sport that combines elements of chess and basketball.",
    "Explain the idea behind Bitcoin using only food analogies.",
    "Write a dialogue between Socrates and a modern AI researcher about the nature of intelligence.",
    "Describe a color to someone who has been blind since birth.",
    "Compose a short speech convincing aliens not to destroy Earth.",
    "Explain the concept of infinity using a metaphor that doesn't involve numbers or math.",
    "Write a job description for a time traveler's assistant.",
    "Create a new philosophical thought experiment that challenges our understanding of reality.",
    "Describe how you would explain the concept of death to an immortal being.",
    "Invent a new emotion and describe how it feels, when it occurs, and its evolutionary purpose.",
    "Write a conversation between your future self and your past self, discussing the most important life lessons.",
    "Describe a day in the life of a sentient cloud.",
    "Create a new system of government based on the behavior of honeybees.",
    "Explain quantum entanglement using only elements from a typical kitchen.",
    "Design a universal language that could be understood by all species on Earth.",
    "Write a creation myth for the Internet age.",
    "Describe how you would teach empathy to an artificial intelligence.",
    "Invent a new primary color and explain its impact on the world.",
    "Compose a poem that can be read forwards and backwards, with different meanings in each direction.",
    "What are the main causes of climate change?",
    "Describe the process of photosynthesis in simple terms.",
    "Explain the concept of supply and demand in economics.",
    "What are the key differences between democracy and autocracy?",
    "How does the human immune system work?",
    "Summarize the plot of Romeo and Juliet in three sentences.",
    "What are the main features of the solar system?",
    "Explain the theory of evolution by natural selection.",
    "What are the primary functions of the United Nations?",
    "Describe the water cycle and its importance to life on Earth.",
    "Explain the biggest differences between Keynesian and Austrian economics.",
    "What are the main principles of the scientific method?",
    "Describe a world where humans communicate solely through music.",
    "Explain the concept of blockchain to a medieval blacksmith.",
    "Design a sustainable city that could exist on Mars.",
    "Write a short story where the protagonist is a sentient algorithm.",
    "Describe how you would reorganize the education system to prepare students for the 22nd century.",
    "Invent a new form of renewable energy and explain how it works.",
    "Create a recipe for a dish that represents world peace.",
    "Explain the importance of biodiversity using only references to a typical household.",
    "Design a new form of transportation that doesn't rely on wheels or engines.",
    "Write a letter from Earth to an alien civilization, introducing our planet and species.",
    "Describe how you would govern a society where everyone can read each other's thoughts.",
    "Explain the concept of time to a being that exists outside of it.",
    "Create a new theory of consciousness that incorporates both biological and artificial intelligence.",
    "Design a universal currency that could be used across different planets and species.",
    "Describe how you would solve overpopulation if teleportation was possible.",
    "Write a manifesto for a political party focused on preparing humanity for first contact with aliens.",
    "Explain how you would create a sustainable economy on a generation ship traveling to another solar system.",
    "Compose a lullaby for a baby robot.",
    "Describe the taste of water to a being that has never experienced liquid.",
    "Create a new art form that combines sculpture and interpretive dance.",
    "Explain the concept of democracy to a hive-mind alien species.",
    "Design a universal translator for animal languages.",
    "Write a creation myth for artificial intelligence.",
    "Describe how you would teach the concept of love to a purely logical being.",
    "Invent a new sense beyond the traditional five and explain how it would work.",
    "Compose a speech for the first human colony on Mars, 100 years after settlement.",
    "Explain the concept of money to a society that has never used currency.",
    "Design a method of communication that works across parallel universes.",
    "Write a short story from the perspective of a photon traveling from the sun to Earth.",
    "Describe how you would organize a global government if suddenly all national borders disappeared.",
    "Invent a new philosophy based on the behavior of quantum particles.",
    "Create a new calendar system for a planet with three moons and two suns.",
    "Explain the concept of music to a species that communicates through bioluminescence.",
    "Design a legal system for a society of shapeshifters.",
    "Write a creation myth for the internet of things.",
    "Describe how you would teach ethics to an artificial general intelligence.",
    "Invent a new form of mathematics based on emotions instead of numbers.",
    "Compose a universal declaration of sentient rights that applies to all forms of consciousness.",
]

model_nicknames = [
    "๐Ÿค– Robo Responder", "๐Ÿง™โ€โ™‚๏ธ Wizard of Words", "๐Ÿฆ„ Unicorn Utterance",
    "๐Ÿง  Brain Babbler", "๐ŸŽญ Prose Performer", "๐ŸŒŸ Stellar Scribe",
    "๐Ÿ”ฎ Crystal Ball Chatter", "๐Ÿฆ‰ Wise Wordsmith", "๐Ÿš€ Rocket Replier",
    "๐ŸŽจ Artful Answerer", "๐ŸŒˆ Rainbow Rhetorician", "๐Ÿ‰ Dragon Dialoguer",
    "๐Ÿฆ Ice Cream Ideator", "๐ŸŒป Sunflower Speechifier", "๐ŸŽฉ Top Hat Thinker",
    "๐ŸŒ‹ Volcano Vocabularian", "๐ŸŒŠ Wave of Wisdom", "๐Ÿ„ Mushroom Muser",
    "๐Ÿฆ‹ Butterfly Bard", "๐ŸŒ  Cosmic Conversationalist",
    "๐ŸŽต Melody Maestro", "๐ŸŒด Palm Tree Philosopher", "๐Ÿ”ฌ Lab Coat Linguist",
    "๐ŸŒ™ Lunar Lyricist", "๐Ÿ• Pizza Poet", "๐ŸŒฟ Herbal Haiku-ist",
    "๐ŸŽช Circus Sage", "๐Ÿฐ Castle Chronicler", "๐ŸŒบ Floral Phraseologist",
    "๐Ÿงฉ Puzzle Master Pontificator", "๐ŸŽญ Mask of Many Voices",
    "๐ŸŒณ Whispering Willow", "๐Ÿ”ง Gadget Guru Gabber", "๐Ÿงฌ Gene Genie Jawer",
    "๐Ÿงธ Teddy Bear Theorist", "๐ŸŽจ Canvas Conversationalist",
    "๐Ÿงช Beaker Babbler", "๐ŸŒˆ Prism Proclaimer", "๐Ÿงต Thread Theorist",
    "๐ŸงŠ Ice Cube Ideator", "๐ŸŽก Ferris Wheel Philosopher",
    "๐ŸŒถ๏ธ Spicy Syntax Spinner", "๐Ÿงœโ€โ™€๏ธ Mermaid Muse", "๐Ÿ„โ€โ™‚๏ธ Surf Sage",
    "๐Ÿง˜โ€โ™‚๏ธ Zen Zephyr", "๐ŸŽข Rollercoaster Raconteur", "๐Ÿงšโ€โ™€๏ธ Fairy Tale Fabricator",
    "๐ŸŒญ Hot Dog Hypothesizer", "๐Ÿง—โ€โ™€๏ธ Cliff Hanger Chronicler", "๐Ÿน Arrow Arguer",
    "๐Ÿงถ Yarn Yarner", "๐ŸŽ  Carousel Cogitator", "๐Ÿงฒ Magnet Metaphorist",
    "๐Ÿฆœ Parrot Paradoxer", "๐ŸŒฎ Taco Theorist", "๐Ÿงจ Firecracker Philosopher",
    "๐ŸŽณ Bowling Bard", "๐Ÿง€ Cheese Chatterer", "๐Ÿฆš Peacock Ponderer"
]