llm-thermometer

Extimate temperature values of LLMs from generated text 🌡️

https://github.com/s1m0n38/llm-thermometer

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Extimate temperature values of LLMs from generated text 🌡️

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing Citation

README.md

🌡️ LLM Thermometer

Docs Status Tag

Estimate temperature values of Large Language Models from semantic similarity of generated text


Research Question

Is it possible to infer the temperature parameter value used by an LLM from only the generated text?

Probably yes.

Example Plot

Similarity between generated texts with same temperature level (various colors) from the prompt: \ "What will technology look like in 2050?"

Approach

LLM Thermometer uses semantic similarity between multiple responses to estimate temperature:

  1. Generation: Produce multiple responses from an LLM using the same prompt
  2. Similarity Analysis: Measure semantic similarity between responses
  3. Temperature Estimation: Infer temperature based on response diversity
    • Higher temperature → More diverse responses (lower similarity)
    • Lower temperature → More consistent responses (higher similarity)

The reports, hosted on GitHub Pages, contains experiments metadata, charts, and tables.

Usage

```bash

Set required environment variables

export LLMAPIKEY="yourapikey" export LLMBASEURL="https://api.provider.com/v1" export EMBAPIKEY="yourembeddingapikey" export EMBBASE_URL="https://api.provider.com/v1" ```

```bash

Generate samples

llm-thermometer generate \ --language-model "model-name" \ --prompt "What will technology look like in 2050?" \ --samples 32 \ --data-dir ./data \ --temperature 0.7 \

Measure semantic similarity

llm-thermometer measure \ --embedding-model "embedding-model-name" \ --data-dir ./data

Generate report

llm-thermometer report \ --data-dir ./data \ --docs-dir ./docs

Or using Makefile...

make generate make measure make report make docs ```

Installation

The preferred way to install llm-thermometer is using uv (although you can also use pip).

```bash

Clone the repository

git clone https://github.com/S1M0N38/llm-thermometer.git cd llm-thermometer

Create a virtual environment

uv init

Install the package

uv sync ```

Models Local Deployment with Docker

If you have a GPU available, you can run both the Language Model and embedding model locally using docker-compose:

```bash

Set HF_HOME environment variable for model caching

export HF_HOME="/path/to/huggingface/cache"

Start the models

docker-compose up -d

Language model will be available at http://localhost:41408

Embedding model will be available at http://localhost:41409

```

Requirements

  • Python 3.12+
  • OpenAI-compatible API endpoints (/chat/completions and /embeddings)
  • NVIDIA GPU (for local deployment with docker-compose)

Contributing

This research project is still in its early stages, and I welcome any feedback, suggestions, and contributions! If you're interested in discussing ideas or have questions about the approach, please start a conversation in GitHub Discussions.

For detailed information on setting up your development environment, understanding the project structure, and the contribution workflow, please refer to CONTRIBUTING.md.

Owner

  • Login: S1M0N38
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below. Note: This is a work in progress."
title: "LLM Thermometer: Estimating Temperature Values of Large Language Models"
abstract: "A tool to estimate temperature parameter values of Large Language Models through semantic similarity analysis of generated text."
authors:
  - family-names: "Bertolotto"
    given-names: "Simone"
    alias: "S1M0N38"
version: 0.6.0
date-released: 2025-03-04
license: MIT
repository-code: "https://github.com/S1M0N38/llm-thermometer"
url: "https://s1m0n38.github.io/llm-thermometer/"
keywords:
  - large-language-models
  - temperature
  - semantic-similarity
  - natural-language-processing
  - embeddings
  - llm-evaluation
  - nlp
preferred-citation:
  type: software
  authors:
    - family-names: "Bertolotto"
      given-names: "Simone"
  title: "LLM Thermometer: Estimating Temperature Values of Large Language Models"
  year: 2025
  url: "https://github.com/S1M0N38/llm-thermometer"
  repository-code: "https://github.com/S1M0N38/llm-thermometer"

GitHub Events

Total
  • Watch event: 1
  • Public event: 1
  • Push event: 5
  • Create event: 1
Last Year
  • Watch event: 1
  • Public event: 1
  • Push event: 5
  • Create event: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/jekyll-gh-pages.yml actions
  • actions/checkout v4 composite
  • actions/configure-pages v5 composite
  • actions/deploy-pages v4 composite
  • actions/jekyll-build-pages v1 composite
  • actions/upload-pages-artifact v3 composite
docker-compose.yml docker
  • ghcr.io/huggingface/text-embeddings-inference 1.6
  • vllm/vllm-openai latest
pyproject.toml pypi
  • jinja2 >=3.1.5
  • matplotlib >=3.10.1
  • openai >=1.64.0
  • pandas >=2.2.3
  • pydantic >=2.10.6
  • scipy >=1.15.2
  • seaborn >=0.13.2
  • tabulate >=0.9.0
  • tqdm >=4.67.1
uv.lock pypi
  • annotated-types 0.7.0
  • anyio 4.8.0
  • argcomplete 3.5.3
  • certifi 2025.1.31
  • cfgv 3.4.0
  • charset-normalizer 3.4.1
  • colorama 0.4.6
  • commitizen 4.3.0
  • contourpy 1.3.1
  • cycler 0.12.1
  • decli 0.6.2
  • distlib 0.3.9
  • distro 1.9.0
  • filelock 3.17.0
  • fonttools 4.56.0
  • h11 0.14.0
  • httpcore 1.0.7
  • httpx 0.28.1
  • identify 2.6.8
  • idna 3.10
  • jinja2 3.1.5
  • jiter 0.8.2
  • kiwisolver 1.4.8
  • llm-thermometer 0.5.2
  • markupsafe 3.0.2
  • matplotlib 3.10.1
  • nodeenv 1.9.1
  • numpy 2.2.3
  • openai 1.65.1
  • packaging 24.2
  • pandas 2.2.3
  • pillow 11.1.0
  • platformdirs 4.3.6
  • pre-commit 4.1.0
  • prompt-toolkit 3.0.50
  • pydantic 2.10.6
  • pydantic-core 2.27.2
  • pyparsing 3.2.1
  • python-dateutil 2.9.0.post0
  • pytz 2025.1
  • pyyaml 6.0.2
  • questionary 2.1.0
  • ruff 0.9.9
  • scipy 1.15.2
  • seaborn 0.13.2
  • six 1.17.0
  • sniffio 1.3.1
  • tabulate 0.9.0
  • termcolor 2.5.0
  • tomlkit 0.13.2
  • tqdm 4.67.1
  • typing-extensions 4.12.2
  • tzdata 2025.1
  • virtualenv 20.29.2
  • wcwidth 0.2.13