How to Configure the Default LLM Model in Hiring Agent
You can configure the default LLM model in Hiring Agent by setting the DEFAULT_MODEL environment variable, which overrides the fallback gemma3:4b defined in main/prompt.py and automatically applies model-specific parameters from MODEL_PARAMETERS.
The interviewstreet/hiring-agent repository centralizes all language model configuration in a single configuration module. Understanding how to configure the default LLM model in Hiring Agent allows you to switch between Ollama and Gemini providers without modifying application logic, as the system resolves providers dynamically at runtime.
Configuration Architecture in main/prompt.py
The configuration system initializes through a strict hierarchy when the application starts. At line 13 of main/prompt.py, the application calls dotenv.load_dotenv() to load environment variables from your .env file.
The resolution logic follows this sequence:
- Fallback definition: Line 16 sets
DEFAULT_MODEL_NAME = "gemma3:4b"as the hardcoded default. - Environment resolution: Line 20 reads
DEFAULT_MODEL = os.getenv("DEFAULT_MODEL", DEFAULT_MODEL_NAME), using the environment variable if present. - Provider selection: Lines 21-26 determine the backend via
LLM_PROVIDER, defaulting toModelProvider.OLLAMA. - Parameter lookup: Lines 27-44 define
MODEL_PARAMETERS, a dictionary mapping each model to itstemperatureandtop_pvalues. - Provider mapping: Lines 48-64 contain
MODEL_PROVIDER_MAPPING, which associates model names with their respective providers (OLLAMAorGEMINI).
Methods to Change the Default Model
Using Environment Variables (Recommended)
Create or modify a .env file in your project root to persist configuration across restarts:
# .env
DEFAULT_MODEL=gemma3:12b
LLM_PROVIDER=ollama
GEMINI_API_KEY=your_key_here # Required only for Gemini models
The application reads these values at startup via the logic at line 20 of main/prompt.py.
Runtime Override
For temporary changes in Python sessions, set the environment variable before importing Hiring Agent components:
import os
from main.prompt import DEFAULT_MODEL, MODEL_PARAMETERS
# Temporarily override the default model
os.environ["DEFAULT_MODEL"] = "gemini-2.5-pro"
# Import and instantiate after setting the variable
from main.evaluator import ResumeEvaluator
evaluator = ResumeEvaluator() # Automatically uses the new DEFAULT_MODEL
Verifying Active Configuration
Inspect the effective model and its parameters:
from main.prompt import DEFAULT_MODEL, MODEL_PARAMETERS
params = MODEL_PARAMETERS.get(DEFAULT_MODEL)
print(f"Using model {DEFAULT_MODEL} with params {params}")
# Output: Using model gemma3:12b with params {'temperature': 0.1, 'top_p': 0.9}
Provider Resolution in main/llm_utils.py
When components like ResumeEvaluator in main/evaluator.py request an LLM, the system delegates to initialize_llm_provider in main/llm_utils.py (lines 53-61). This function consults MODEL_PROVIDER_MAPPING from main/prompt.py to determine whether to instantiate an Ollama client or a Google Gemini client based on the model name provided.
Summary
- Configure the default LLM model in Hiring Agent by setting the
DEFAULT_MODELenvironment variable, which overrides thegemma3:4bfallback defined at line 16 ofmain/prompt.py. - The system automatically selects the provider via
LLM_PROVIDER(defaulting to Ollama) and validates it againstMODEL_PROVIDER_MAPPINGat lines 48-64. - Model-specific inference parameters (
temperature,top_p) are retrieved fromMODEL_PARAMETERSat lines 27-44 ofmain/prompt.py. - The
initialize_llm_providerfunction inmain/llm_utils.py(lines 53-61) handles dynamic client instantiation based on the resolved model name and provider.
Frequently Asked Questions
What is the default LLM model if no environment variables are set?
If DEFAULT_MODEL is not configured, Hiring Agent defaults to gemma3:4b as specified by the DEFAULT_MODEL_NAME constant at line 16 of main/prompt.py. The provider defaults to Ollama via ModelProvider.OLLAMA as implemented at lines 21-26.
Can I use Google Gemini models instead of Ollama?
Yes. Set DEFAULT_MODEL to a Gemini-specific identifier (such as gemini-2.5-pro) and ensure LLM_PROVIDER is set to gemini or that your model appears in the MODEL_PROVIDER_MAPPING at lines 48-64 of main/prompt.py. You must also provide a valid GEMINI_API_KEY in your environment variables.
Where are the temperature and top_p parameters defined?
These inference parameters are stored in the MODEL_PARAMETERS dictionary at lines 27-44 of main/prompt.py. Each supported model name maps to a dictionary containing temperature and top_p values that the system passes to the provider client during initialization.
How does the application know which provider API to call?
The initialize_llm_provider function in main/llm_utils.py (lines 53-61) uses the MODEL_PROVIDER_MAPPING dictionary from main/prompt.py to look up whether a given model name belongs to Ollama or Gemini, then instantiates the corresponding client class for API communication.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →