[Bug] Litellm reports wrong tool schema to the server

Aperta
#43 0 commenti 0 reazioni 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@AnkitaNaik ci sta già lavorando.

Dal 5/11/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start by tracing how benchmark_runner.py builds tool definitions for the LiteLLM provider, then compare the outgoing schema in the issue with the tool explorer's expected schema. Reproduce with the provided benchmark command and inspect the linked LiteLLM log. Done when the request exposes publisher_id and min_pages as required tool parameters.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
Litellm reports wrong tool schema to the server which confuses the model and none of the tools with required args are called successfully

To Reproduce
Steps to reproduce the behavior:
(Tested on 3.14.8 system package and 3.11 & 3.12 packages from uv)

  1. Follow install instructions
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[init]"
pip install -r requirements_benchmark.txt
make download
make build
docker compose up 
  1. Install langchain integration
pip install langchain-litellm
  1. Launch benchmark targeting openai-compatable endpoint (vllm in my case)
OPENAI_API_KEY="EMPTY" LITELLM_BASE_URL=http://127.0.0.1:7700/v1 python benchmark_runner.py --capability_id 2 --provider litellm --model Qwen/Qwen3.5-122B-A10B-FP8 --temperature 0.6
  1. Observe debug logs containing POST Request Sent from LiteLLM
 {
 'type': 'function',
 'function':
  {
    'name': 'get_count_books_by_publisher_and_pages',
    'description': "Retrieves the total count of books from a specific publisher that have more than a specified number of pages. The operation requires the publisher's ID and the minimum number of pages as input parameters.",
    'parameters':
      {
        'properties':
          {
            'args': {'default': None, 'items': {}, 'type': 'array'},
            'config':
              {
                'description': 'Configuration for a "Runnable".\n\n!!! note Custom values\n\n    The "TypedDict" has "total=False" set intentionally to:\n\n    - Allow partial configs to be created and merged together via "merge_configs"\n    - Support config propagation from parent to child runnables via\n        "var_child_runnable_config" (a "ContextVar" that automatically passes\n        config down the call stack without explicit parameter passing), where\n        configs are merged rather than replaced\n\n    !!! example\n\n        """python\n        # Parent sets tags\n        chain.invoke(input, config={"tags": ["parent"]})\n        # Child automatically inherits and can add:\n        # ensure_config({"tags": ["child"]}) -> {"tags": ["parent", "child"]}\n        """',

                'properties': {'tags': {'items': {'type': 'string'}, 'type': 'array'}, 'metadata': {'additionalProperties': True, 'type': 'object'}, 'callbacks': {'anyOf': [{'items': {}, 'type': 'array'}, {}, {'type': 'null'}]}, 'run_name': {'type': 'string'}, 'max_concurrency': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'recursion_limit': {'type': 'integer'}, 'configurable': {'additionalProperties': True, 'type': 'object'}, 'run_id': {'anyOf': [{'format': 'uuid', 'type': 'string'}, {'type':   'null'}]}}, 'type': 'object'
              },
            'kwargs': {'additionalProperties': True, 'default': None, 'type': 'object'}
          },
        'required': ['config'],
        'type': 'object'
      }
  }
}

Expected behavior
Correct schema (same as in tool explorer)

{
  "properties": {
    "publisher_id": {
      "type": "integer",
      "description": "ID of the publisher"
    },
    "min_pages": {
      "type": "integer",
      "description": "Minimum number of pages"
    }
  },
  "required": [
    "publisher_id",
    "min_pages"
  ]
}

Example of full POST sent by LiteLLM
litellm_log.txt

Lingua principale
Python
Stelle
79
Fork
23
Merge medio
2g 7h
PR unite (30g)
3

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IBM/vakra

Tutte le issue di IBM/vakra

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.