{"slug": "hf-inference-reports-an-error-for-my-model-after-inference-was-enabled", "title": "Hf-inference reports an error for my model after Inference was enabled", "summary": "A model hosted on Hugging Face's serverless Inference API fails its health check when its README.md declares the `translation` pipeline tag for a `LlamaForCausalLM` architecture, because the `transformers` translation pipeline expects encoder-decoder (Seq2Seq) models while Llama is decoder-only. The fix is to change the YAML frontmatter pipeline tag to `text-generation`, which lets the Inference API load the model with `AutoModelForCausalLM`; translation can still be done by sending custom instruction prompts and special tokens to the text generation endpoint.", "body_md": "The `hf-inference` error occurs because the `LlamaForCausalLM` architecture is incompatible with the `translation` pipeline tag.\n\nIn the `transformers` library, the `translation` pipeline is designed for encoder-decoder (Seq2Seq) architectures. Since Llama is a decoder-only causal language model, the serverless Inference API fails when it attempts to initialize the weights inside a translation pipeline during the health check.\n\nTo fix this, update the YAML frontmatter in your repository’s `README.md` to use the `text-generation` pipeline tag. The Inference API will then correctly load the model using `AutoModelForCausalLM`. You can still perform translation by passing your custom instruction prompts and special tokens directly to the text generation endpoint.", "url": "https://wpnews.pro/news/hf-inference-reports-an-error-for-my-model-after-inference-was-enabled", "canonical_source": "https://discuss.huggingface.co/t/hf-inference-reports-an-error-for-my-model-after-inference-was-enabled/193219#post_2", "published_at": "2026-12-06 16:13:56+00:00", "updated_at": "2026-12-06 16:16:22.367699+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "ai-infrastructure"], "entities": ["Hugging Face", "LlamaForCausalLM", "transformers", "AutoModelForCausalLM", "Inference API"], "also_reported_by": [], "takeaway": "Set the README.md pipeline tag to `text-generation` for decoder-only Llama models on the serverless Inference API, since the `translation` tag triggers a Seq2Seq pipeline health-check failure; translation still works via instruction prompts on the text generation endpoint.", "recommendation": {"advice": "Tag decoder-only Llama models as `text-generation` in README.md frontmatter instead of `translation`, which expects Seq2Seq architectures and fails the Inference API health check.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/hf-inference-reports-an-error-for-my-model-after-inference-was-enabled", "markdown": "https://wpnews.pro/news/hf-inference-reports-an-error-for-my-model-after-inference-was-enabled.md", "text": "https://wpnews.pro/news/hf-inference-reports-an-error-for-my-model-after-inference-was-enabled.txt", "jsonld": "https://wpnews.pro/news/hf-inference-reports-an-error-for-my-model-after-inference-was-enabled.jsonld"}}