Krishna Chaitanya Cheedella
Refactor to use FREE HuggingFace models + OpenAI instead of OpenRouter
aa61236
"""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