{"record":{"id":"32e20bbf8e42bae3","repo":"huggingface/transformers","slug":"unknown-logit-processor-kwargs-unknown-keys-s","errorCode":null,"errorMessage":"Unknown logit_processor_kwargs: {unknown_keys}. {self.supported_keys = } and {self.ignored_keys = }If you expect a key to not be ignored, make sure its default value (in the generation config) is not None. Eg. if temperature is None or 1.0 at creation time, no processor will be created for temperature","messagePattern":"Unknown logit_processor_kwargs: (.+?)\\. (.+?) and (.+?)If you expect a key to not be ignored, make sure its default value \\(in the generation config\\) is not None\\. Eg\\. if temperature is None or 1\\.0 at creation time, no processor will be created for temperature","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/generation/continuous_batching/cb_logits_processors.py","lineNumber":171,"sourceCode":"            return None\n        # Validate types for supported keys, detect unsupported keys\n        problematic_keys = set()\n        for key, value in kwargs.items():\n            if key not in self.supported_keys:\n                problematic_keys.add(key)\n            else:\n                expected_type = self.supported_keys[key]\n                if not isinstance(value, expected_type):\n                    raise TypeError(\n                        f\"logit_processor_kwargs['{key}'] has type {type(value).__name__}, expected {expected_type.__name__}\"\n                    )\n        # Stop if there are only supported keys\n        if not problematic_keys:\n            return\n        # Check if there are unknown keys\n        unknown_keys = problematic_keys - self.ignored_keys\n        if unknown_keys:\n            raise ValueError(\n                f\"Unknown logit_processor_kwargs: {unknown_keys}. {self.supported_keys = } and {self.ignored_keys = }\"\n                \"If you expect a key to not be ignored, make sure its default value (in the generation config) is not \"\n                \"None. Eg. if temperature is None or 1.0 at creation time, no processor will be created for temperature\"\n            )\n        # If there are none, throw a warning about the ignored keys\n        logger.warning(\n            f\"Ignored logit_processor_kwargs: {problematic_keys}. {self.supported_keys = } and {self.ignored_keys = }\"\n        )\n\n    def fill_defaults(self, int32_tensor: torch.Tensor) -> None:\n        \"\"\"Fills the given tensor int32 tensor with the default values for this processor.\"\"\"\n        i = 0\n        for processor in self.logits_processor:\n            if isinstance(processor, ContinuousBatchingLogitsProcessor):\n                processor.fill_defaults(int32_tensor[i])\n                i += 1\n\n    def prepare_tensor_args(","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/generation/continuous_batching/cb_logits_processors.py#L153-L189","documentation":"Raised by CB logits-processor check_kwargs when logit_processor_kwargs contains keys that are neither in supported_keys nor in ignored_keys. supported_keys only contains processors that were actually instantiated, which depends on the generation config defaults: if a param like temperature defaults to None or 1.0, no processor exists for it and passing it is treated as unknown.","triggerScenarios":"Passing logit_processor_kwargs={'top_p': 0.9} while the GenerationConfig has top_p=1.0 (no top_p processor created), so 'top_p' is not in supported_keys and not in ignored_keys. Same for any sampling param whose default disabled its processor.","commonSituations":"Enabling sampling via kwargs at call time while the generation config was created with greedy defaults; upgrading versions where the supported-keys registry changed; mixing HF generate kwargs with logit_processor_kwargs.","solutions":["Set the parameter in the GenerationConfig (e.g. model.generation_config.temperature = 0.8) before creating the manager so the processor gets created","Remove the offending key from logit_processor_kwargs — the message prints supported_keys and ignored_keys, use them","Construct GenerationConfig(temperature=..., top_p=...) at model load time rather than relying on call-time kwargs"],"exampleFix":"# before\nmodel.generation_config = GenerationConfig(do_sample=False)  # temperature stays None\nkwargs = {\"temperature\": 0.8}\n\n# after\nmodel.generation_config = GenerationConfig(do_sample=True, temperature=1.0)\nkwargs = {\"temperature\": 0.8}","handlingStrategy":"validation","validationCode":"gc = model.generation_config\n# make sure processors exist for the sampling params you plan to pass\nif 'temperature' in my_kwargs and (gc.temperature is None or gc.temperature == 1.0):\n    gc.temperature = 1.0  # non-None default creates the processor","typeGuard":null,"tryCatchPattern":"try:\n    manager = model.continuous_batching(logit_processor_kwargs=lpk)\nexcept ValueError as e:\n    if 'Unknown logit_processor_kwargs' in str(e):\n        for k in list(lpk):\n            setattr(model.generation_config, k, lpk[k])  # create the processors\n        manager = model.continuous_batching(logit_processor_kwargs=lpk)\n    else:\n        raise","preventionTips":["Set sampling params in GenerationConfig at load time","Read supported_keys from the error message to see what exists","Don't assume vLLM-style all-kwargs-accepted behavior"],"tags":["validation","logits-processor","generation-config","continuous-batching"],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}