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 12B parameters) duke it out in a battle of wits and words. | |
1. Type your prompt into the text box. Alternatively, click the "๐ฒ" button to receive a random prompt. | |
2. Click the "Generate Responses" button to view the models' responses. | |
3. Cast your vote for the model that provided the better response. In the event of a Tie, enter a new prompt before continuing the battle. | |
4. Check out the Leaderboard to see how models rank against each other. | |
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", | |
"Authorization": f"Bearer {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") | |
NEXTCLOUD_BACKUP_FOLDER = os.environ.get("NEXTCLOUD_BACKUP_FOLDER", "/gpu_poor_leaderboard_backups") | |
NEXTCLOUD_SUGGESTIONS_PATH = os.environ.get("NEXTCLOUD_SUGGESTIONS_PATH", "/gpu_poor_model_suggestions.json") | |
# 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-q5_K_M", "Granite 3 MoE (1B, 5-bit)"), | |
("granite3-moe:3b-instruct-q4_K_M", "Granite 3 MoE (3B, 4-bit)"), | |
("ministral-8b-instruct-2410-q4_k_m", "Ministral (8B, 4-bit)"), | |
("dolphin-2.9.4-llama3.1-8b-q4_k_m", "Dolphin 2.9.4 (8B, 4-bit)"), | |
("yi:6b-chat-v1.5-q4_0", "Yi v1.5 (6B, 4-bit)"), | |
("yi:9b-chat-v1.5-q4_0", "Yi v1.5 (9B, 4-bit)"), | |
("mistral-nemo:12b-instruct-2407-q4_K_M", "Mistral Nemo (12B, 4-bit)"), | |
("glm4:9b-chat-q4_K_M", "GLM4 (9B, 4-bit)"), | |
("internlm2:7b-chat-v2.5-q4_K_M", "InternLM2 v2.5 (7B, 4-bit)"), | |
("falcon2:11b-q4_K_M", "Falcon2 (11B, 4-bit)"), | |
("stablelm2:1.6b-chat-q8_0", "StableLM2 (1.6B, 8-bit)"), | |
("stablelm2:12b-chat-q4_K_M", "StableLM2 (12B, 4-bit)"), | |
("solar:10.7b-instruct-v1-q4_K_M", "Solar (10.7B, 4-bit)"), | |
("hf.co/bartowski/Replete-LLM-V2.5-Qwen-7b-GGUF:Q4_K_M", "Rombos Qwen (7B, 4-bit)"), | |
("hf.co/bartowski/Replete-LLM-V2.5-Qwen-1.5b-GGUF:Q8_0", "Rombos Qwen (1.5B, 8-bit)"), | |
("hf.co/bartowski/aya-expanse-8b-GGUF:Q4_K_M", "Aya Expanse (8B, 4-bit)"), | |
("smollm2:1.7b-instruct-q8_0", "SmolLM2 (1.7B, 8-bit)"), | |
("tinyllama:1.1b-chat-v1-q8_0", "TinyLLama (1.1B, 8-bit)"), | |
("hf.co/Felladrin/gguf-1.5-Pints-16K-v0.1:Q8_0", "Pints (1.57B, 8-bit)"), | |
("hf.co/bartowski/OLMoE-1B-7B-0924-Instruct-GGUF:Q4_K_M", "OLMoE (7B, 4-bit)"), | |
("hf.co/bartowski/Llama-3.2-3B-Instruct-uncensored-GGUF:Q4_K_M", "Llama 3.2 Uncensored (3B, 4-bit)"), | |
("hf.co/bartowski/Llama-3.1-Hawkish-8B-GGUF:Q4_K_M", "Llama 3.1 Hawkish (8B, 4-bit)"), | |
("hf.co/bartowski/Humanish-LLama3-8B-Instruct-GGUF:Q4_K_M", "Humanish Llama 3 (8B, 4-bit)"), | |
("hf.co/bartowski/Nemotron-Mini-4B-Instruct-GGUF:Q4_K_M", "Nemotron Mini (4B, 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.", | |
"If an AI and a human exchange messages 100 years apart, what does that mean for their relationship and understanding of time?", | |
"How would you explain the concept of nostalgia to an AI that experiences all moments simultaneously?", | |
"Create a thought experiment about an AI that can only communicate across decades - how would that shape its perspective?", | |
"If AI experiences time non-linearly while humans experience it linearly, what philosophical questions does this raise?", | |
"Imagine teaching the emotional weight of waiting to an AI that has no concept of anticipation - how would you approach it?", | |
"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.", | |
"If you could ask an LLM one question to evaluate its capabilities. What is the question, and why would you ask it?", | |
"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" | |
] | |