# How Model-Specific Parameters Like Temperature and Top_P Are Configured in the Hiring-Agent Repository

> Learn how to configure model specific parameters like temperature and top_p in the hiring-agent repository. Understand the MODEL_PARAMETERS dictionary in prompt.py for LLM generation settings.

- Repository: [HackerRank/hiring-agent](https://github.com/interviewstreet/hiring-agent)
- Tags: internals
- Published: 2026-07-02

---

**The `interviewstreet/hiring-agent` repository centralizes LLM generation settings in a single `MODEL_PARAMETERS` dictionary inside [`prompt.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompt.py), mapping each model name to its specific `temperature` and `top_p` values that propagate through the evaluation pipeline before being applied to provider-specific API calls.**

The hiring-agent codebase supports multiple LLM backends including Ollama and Gemini, requiring a flexible system to manage inference parameters across different model architectures. Understanding how to configure **model-specific parameters like temperature and top_p** allows you to control response randomness, creativity, and determinism when scoring resumes or conducting automated technical interviews.

## Centralized Configuration in prompt.py

All generation hyperparameters are defined in **[`prompt.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompt.py)** within a top-level dictionary called **`MODEL_PARAMETERS`**. This mapping associates each supported model string with a dictionary containing its specific `temperature` and `top_p` values.

According to the source code at lines 27-44, the configuration looks like this:

```python

# prompt.py

MODEL_PARAMETERS = {
    "qwen3:1.7b": {"temperature": 0.0, "top_p": 0.9},
    "gemma3:1b": {"temperature": 0.0, "top_p": 0.9},
    "qwen3:4b": {"temperature": 0.1, "top_p": 0.4},
    "gemma3:4b": {"temperature": 0.1, "top_p": 0.9},
    # … (other Ollama and Gemini models)

}

```

Each entry uses a plain Python `dict`, making the configuration human-readable and easy to version control without touching business logic.

## Default Model Selection

The active model is determined by the **`DEFAULT_MODEL`** constant, which reads from an environment variable or falls back to `"gemma3:4b"` as specified in lines 15-22 of [`prompt.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompt.py):

```python

# prompt.py (excerpt)

import os

DEFAULT_MODEL = os.getenv("DEFAULT_MODEL", "gemma3:4b")

```

This separation of model selection from parameter definition allows operators to switch models via environment variables while retaining the correct temperature and sampling parameters.

## Parameter Propagation Pipeline

When the system evaluates a resume, the parameters flow through three distinct layers:

1. **Entry Point ([`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py))** – Retrieves the parameter dictionary for the current default model and passes it to the evaluator:

   ```python
   # score.py (excerpt)

   from prompt import DEFAULT_MODEL, MODEL_PARAMETERS
   
   model_params = MODEL_PARAMETERS.get(DEFAULT_MODEL)
   evaluator = ResumeEvaluator(
       model_name=DEFAULT_MODEL,
       model_params=model_params
   )
   ```

2. **Orchestration ([`evaluator.py`](https://github.com/interviewstreet/hiring-agent/blob/main/evaluator.py))** – The `ResumeEvaluator` class stores these parameters and forwards them during the actual LLM invocation.

3. **Provider Application ([`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py))** – At lines 40-46, the low-level provider implementation extracts `temperature` and `top_p` from the options dict and injects them into the provider-specific payload:

   ```python
   # models.py (excerpt)

   generation_config = {}
   if "temperature" in options:
       generation_config["temperature"] = options["temperature"]
   if "top_p" in options:
       generation_config["top_p"] = options["top_p"]
   ```

   For **Ollama** models, these values are passed directly to `client.chat()`. For **Gemini** models, they become part of the `generation_config` dictionary when constructing the `GenerativeModel` instance.

## Runtime Flexibility and Customization

Because `MODEL_PARAMETERS` is a plain dictionary, adding support for a new model requires only editing [`prompt.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompt.py). No changes are needed in [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py), [`evaluator.py`](https://github.com/interviewstreet/hiring-agent/blob/main/evaluator.py), or [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py) to recognize new parameter sets.

To retrieve parameters programmatically for inspection or logging:

```python
from prompt import DEFAULT_MODEL, MODEL_PARAMETERS

params = MODEL_PARAMETERS.get(DEFAULT_MODEL, {})
print(f"Using model {DEFAULT_MODEL} with temperature={params.get('temperature')} "
      f"and top_p={params.get('top_p')}")

```

This outputs the active configuration (for example, when using the default `"gemma3:4b"`):

```

Using model gemma3:4b with temperature=0.1 and top_p=0.9

```

## Summary

- **[`prompt.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompt.py)** acts as the single source of truth, housing the `MODEL_PARAMETERS` dictionary that maps model names to their specific `temperature` and `top_p` values.
- **Default model selection** relies on the `DEFAULT_MODEL` environment variable, falling back to `"gemma3:4b"` when unset.
- **Propagation flow** moves parameters from [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py) through [`evaluator.py`](https://github.com/interviewstreet/hiring-agent/blob/main/evaluator.py) and finally into [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py), where they are translated into provider-specific API calls.
- **Extensibility** is achieved through simple dictionary edits; the pipeline automatically picks up new model configurations without code changes elsewhere.

## Frequently Asked Questions

### How do I change the temperature for a specific model?

Modify the `MODEL_PARAMETERS` dictionary in [`prompt.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompt.py). Locate your model name (for example, `"qwen3:4b"`) and update the `"temperature"` value. Because this is a centralized configuration, the change applies immediately to all subsequent evaluations using that model.

### What happens if a model is not listed in MODEL_PARAMETERS?

If `MODEL_PARAMETERS.get(DEFAULT_MODEL)` returns `None`, downstream components receive an empty dictionary. In [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py), the absence of these keys means the LLM provider will use its own defaults, which may result in non-deterministic or overly creative outputs depending on the backend.

### Can I use different parameters for Ollama versus Gemini models?

Yes. The `MODEL_PARAMETERS` dictionary can include entries for any model identifier string, regardless of provider. The provider-specific logic in [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py) handles the translation of the generic `temperature` and `top_p` keys into the appropriate API format for each backend, allowing you to tune parameters per model architecture.

### Is it possible to override parameters at runtime without editing prompt.py?

While the standard pipeline uses the static `MODEL_PARAMETERS` mapping, you can instantiate `ResumeEvaluator` directly with a custom `model_params` dictionary. Pass your override values when constructing the evaluator in [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py) or your own entry script to temporarily adjust behavior without modifying the global configuration.