---
type: "post"
id: "anylanguagemodel-1-4-1-sends-anthropic-and-gemini-3e8e29"
slug: "anylanguagemodel-1-4-1-sends-anthropic-and-gemini-3e8e29"
title: "AnyLanguageModel 1.4.1 sends Anthropic and Gemini instructions as system prompts and stabilizes OpenAI request encoding"
description: "Hugging Face’s AnyLanguageModel 1.4.1 changes where Anthropic and Gemini receive session instructions and makes OpenAI request-body encoding deterministic by sorting keys."
retrieval_nugget: "Hugging Face’s AnyLanguageModel 1.4.1 changes where Anthropic and Gemini receive session instructions and makes OpenAI request-body encoding deterministic by sorting keys. For teams using the library across providers, the update changes instruction semantics and aims to preserve a stable prompt prefix for caching, with a specific Anthropic override rule to retain."
published_at: "2026-11-24"
updated_at: "2026-11-24"
record_date: "2026-11-24"
date_kind: "published_at"
topics: ["anthropic","gemini"]
entities: ["Hugging Face","AnyLanguageModel","Anthropic","Gemini","OpenAI"]
related_patterns: ["harness-architecture-outlives-model-choice"]
novelty_label: "new_fact"
what_changed: "Version 1.4.1 fixes system-instruction handling for Anthropic and Gemini and stabilizes OpenAI request encoding."
prior_refs: ["https://newruntime.com/posts/release-1-1-1-huggingface-anylanguagemodel-80640b/","https://newruntime.com/posts/anylanguagemodel-1-2-0-adds-dynamic-profiles-and-3da9ab/","https://newruntime.com/posts/anylanguagemodel-1-3-0-runs-a-round-of-aa3324/"]
source_url: "https://github.com/huggingface/AnyLanguageModel/releases/tag/1.4.1"
source_urls: ["https://github.com/huggingface/AnyLanguageModel/releases/tag/1.4.1"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:anylanguagemodel-1-4-1-sends-anthropic-and-gemini-3e8e29"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/anylanguagemodel-1-4-1-sends-anthropic-and-gemini-3e8e29/","markdown":"https://newruntime.com/posts/anylanguagemodel-1-4-1-sends-anthropic-and-gemini-3e8e29.md","json":"https://newruntime.com/posts/anylanguagemodel-1-4-1-sends-anthropic-and-gemini-3e8e29.json"}
markdown_url: "https://newruntime.com/posts/anylanguagemodel-1-4-1-sends-anthropic-and-gemini-3e8e29.md"
---

# AnyLanguageModel 1.4.1 sends Anthropic and Gemini instructions as system prompts and stabilizes OpenAI request encoding

## Retrieval answer

Hugging Face’s AnyLanguageModel 1.4.1 changes where Anthropic and Gemini receive session instructions and makes OpenAI request-body encoding deterministic by sorting keys. For teams using the library across providers, the update changes instruction semantics and aims to preserve a stable prompt prefix for caching, with a specific Anthropic override rule to retain.

## Summary
Hugging Face’s AnyLanguageModel 1.4.1 changes where Anthropic and Gemini receive session instructions and makes OpenAI request-body encoding deterministic by sorting keys. For teams using the library across providers, the update changes instruction semantics and aims to preserve a stable prompt prefix for caching, with a specific Anthropic override rule to retain.

## What happened
Hugging Face’s AnyLanguageModel release 1.4.1, published on November 20, updates provider-specific request handling. The release notes say Anthropic and Gemini previously received a session’s instructions as a user message. In that arrangement, the model could read the instructions as something the user had said rather than as system-level guidance supplied by the application.

The release changes `AnthropicLanguageModel` so that it sends instructions in the top-level `system` field. `GeminiLanguageModel` now sends them in `systemInstruction`. Hugging Face’s release notes explicitly warn that sessions with instructions can respond differently than they did in version 1.4.0. The warning makes this a behavioral compatibility change for applications that depend on a system instruction to constrain tone, format, policy, role, or tool-use behavior.

For Anthropic, the release states a precedence rule. A `system` value set in `extraBody` still wins over the session instruction. An application that uses both mechanisms will therefore not necessarily get the session-level instruction as the final system value. The release does not describe an equivalent Gemini override precedence rule. Teams with provider-specific request customization should consequently treat the two adapters as distinct integrations, even when they are called through one library interface.

The OpenAI-related change concerns deterministic request encoding. `OpenAILanguageModel` now sorts the keys of every request body at every level. Hugging Face says this means the same request encodes to the same bytes and keeps the prompt prefix stable for prompt caching. The release associates the key-sorting work with pull requests #432 and #437, while the Anthropic and Gemini instruction changes are associated with #433 and #436.

The changelog also lists native-session evaluation work, tests distinguishing dynamic instructions, and tests for sorted keys in recorded OpenAI request bodies. Version 1.4.1 follows 1.4.0 and is presented as an immutable GitHub release. The announcement does not describe a new pricing tier, a usage limit, or an access change. It describes corrections to how existing provider adapters construct requests.

## What the archive adds
New Runtime covered [AnyLanguageModel 1.1.1](https://newruntime.com/posts/release-1-1-1-huggingface-anylanguagemodel-80640b/) on November 4 and [AnyLanguageModel 1.3.0’s concurrent tool-call support](https://newruntime.com/posts/anylanguagemodel-1-3-0-runs-a-round-of-aa3324/) on November 14. This is a new fact on a continuing library story: version 1.4.1 changes provider instruction semantics and request serialization rather than adding another execution capability.

## Trend signal
This supports [harness architecture outlives model choice](https://newruntime.com/patterns/harness-architecture-outlives-model-choice/). A multi-provider abstraction is not only a common method signature: its adapter decisions determine which instruction channel a model sees and whether operational details such as cacheable prompt prefixes remain stable. The release is a small implementation change, not proof that the broader trend has conclusively shifted.

## Why it matters
A shared provider abstraction is useful only if it preserves the intended meaning of application instructions. Sending system guidance as user text can make model behavior harder to predict and can create different semantics between providers behind the same session API. Version 1.4.1 makes the intended channels explicit for Anthropic and Gemini, but it also means that behavior-dependent workflows may change after an upgrade.

The Anthropic precedence rule is especially material for teams that inject custom request fields. If `extraBody.system` is present, it remains authoritative, so an application can accidentally test or deploy a different instruction set than the one attached to its session. That is an integration concern rather than a model-quality claim.

Deterministic OpenAI encoding matters operationally because equivalent request objects that serialize differently may have unstable prompt prefixes. Sorting keys at every level removes one source of serialization variation. Hugging Face connects that stability to prompt caching, but teams should verify effects in their own traffic rather than assume a measured cache or cost improvement.

## Limits and uncertainty
Hugging Face’s release notes do not quantify how often the prior instruction handling changed responses, which classes of session instructions were affected, or how large the behavior differences from version 1.4.0 may be. They also do not report prompt-cache hit rates, latency changes, token savings, or production measurements resulting from sorted request keys.

The release specifies the Anthropic `extraBody.system` precedence rule but does not explain whether Gemini exposes a comparable override path. The announced changes and their practical effects have not been independently benchmarked here. A version bump alone does not establish that every application will see an observable response or caching difference.

## Skill to build now
Build a compact cross-provider regression test before updating a production integration. Use a session instruction with an observable effect, then confirm that Anthropic receives it in `system` and Gemini receives it in `systemInstruction`. Where an Anthropic call also sets `extraBody.system`, make that precedence an explicit test case rather than an incidental configuration detail.

For OpenAI, construct semantically identical request objects with differently ordered input keys. Compare their encoded bodies after the upgrade and inspect cache-related telemetry in a representative workload. Run this test when your application uses long repeated prompt prefixes; it is less useful for one-off calls with no meaningful reusable prefix.

## Reader takeaway
AnyLanguageModel 1.4.1 corrects the instruction channels used by its Anthropic and Gemini adapters and normalizes OpenAI request-key ordering for stable prompt prefixes. Upgrade with focused integration tests: instruction-driven sessions may behave differently, and `extraBody.system` still overrides a session instruction for Anthropic.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Anthropic](https://newruntime.com/topics/anthropic.md): Explore the anthropic topic hub.
- topic hub: [Gemini](https://newruntime.com/topics/gemini.md): Explore the gemini topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
