Spaces:
Running
Running
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)") | |
] | |
# 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.", | |
] | |
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" | |
] | |