File size: 2,763 Bytes
aa61236 |
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 |
"""Configuration for LLM Council using FREE HuggingFace models + OpenAI."""
import os
from dotenv import load_dotenv
load_dotenv()
# API Keys
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
HUGGINGFACE_API_KEY = os.getenv("HUGGINGFACE_API_KEY") # For Inference API
# Council members - Mix of FREE HuggingFace models + OpenAI
# HuggingFace Inference API provides free access to many models
COUNCIL_MODELS = [
# OpenAI models (using your key)
{
"id": "openai/gpt-4o-mini",
"provider": "openai",
"model": "gpt-4o-mini",
"description": "OpenAI GPT-4o mini - fast and capable"
},
{
"id": "openai/gpt-3.5-turbo",
"provider": "openai",
"model": "gpt-3.5-turbo",
"description": "OpenAI GPT-3.5 Turbo - reliable"
},
# FREE HuggingFace models via Inference API
{
"id": "meta-llama/Llama-3.3-70B-Instruct",
"provider": "huggingface",
"model": "meta-llama/Llama-3.3-70B-Instruct",
"description": "Meta Llama 3.3 70B - excellent reasoning"
},
{
"id": "Qwen/Qwen2.5-72B-Instruct",
"provider": "huggingface",
"model": "Qwen/Qwen2.5-72B-Instruct",
"description": "Qwen 2.5 72B - strong performance"
},
{
"id": "mistralai/Mixtral-8x7B-Instruct-v0.1",
"provider": "huggingface",
"model": "mistralai/Mixtral-8x7B-Instruct-v0.1",
"description": "Mixtral 8x7B - mixture of experts"
},
]
# Chairman model - Use OpenAI GPT-4o for best synthesis
CHAIRMAN_MODEL = {
"id": "openai/gpt-4o-mini",
"provider": "openai",
"model": "gpt-4o-mini",
"description": "OpenAI GPT-4o mini - excellent synthesis"
}
# Alternative configurations
#
# ALL FREE (HuggingFace only):
# COUNCIL_MODELS = [
# {"id": "meta-llama/Llama-3.3-70B-Instruct", "provider": "huggingface", ...},
# {"id": "Qwen/Qwen2.5-72B-Instruct", "provider": "huggingface", ...},
# {"id": "mistralai/Mixtral-8x7B-Instruct-v0.1", "provider": "huggingface", ...},
# {"id": "google/gemma-2-27b-it", "provider": "huggingface", ...},
# {"id": "microsoft/Phi-3.5-mini-instruct", "provider": "huggingface", ...},
# ]
#
# PREMIUM (More OpenAI):
# COUNCIL_MODELS = [
# {"id": "openai/gpt-4o", "provider": "openai", "model": "gpt-4o", ...},
# {"id": "openai/gpt-4o-mini", "provider": "openai", "model": "gpt-4o-mini", ...},
# {"id": "meta-llama/Llama-3.3-70B-Instruct", "provider": "huggingface", ...},
# {"id": "Qwen/Qwen2.5-72B-Instruct", "provider": "huggingface", ...},
# ]
# Data directory for conversation storage
DATA_DIR = "data/conversations"
# Timeout settings
DEFAULT_TIMEOUT = 120.0
CHAIRMAN_TIMEOUT = 180.0
# Retry settings
MAX_RETRIES = 2
RETRY_DELAY = 2.0
|