# Prompt variables moving between LangSmith/LangChain {var} and Langfuse {{var}} (30 Oct 2026, IST)

Local only: no accounts, no network, no model calls. Langfuse prompt objects are built in memory (`TextPromptClient(Prompt_Text(...))`), so this tests the SDKs' own template code, not either vendor's server. Box: Linux, Python 3.13.5, langfuse 5.0.4, langchain-core 1.7.3, langsmith 0.14.16 (fresh venv). Run ~11:20-11:25 IST.

| Case | Result |
|---|---|
| LangSmith-style `Hi {name}, order {order_id}` compiled by Langfuse | Returned unchanged: `Hi {name}, order {order_id} has shipped.` No error; `.variables` = `[]` |
| Langfuse-style `Hi {{name}}, order {{order_id}}` in LangChain's default f-string `PromptTemplate` | `input_variables` = `[]`; `format(name=..., order_id=...)` returned `Hi {name}, order {order_id} has shipped.` No error |
| Langfuse `compile()` on `{{var}}` | `Hi Asha, order A-17 has shipped.` |
| Langfuse `get_langchain_prompt()` then LangChain `format()` | `Hi {name}...` then `Hi Asha, order A-17 has shipped.` |
| LangChain `template_format="mustache"` on `{{var}}` | `Hi Asha, order A-17 has shipped.` |
| Missing variable, Langfuse `compile(name=...)` only | `Hi Asha, order {{order_id}} has shipped.` (placeholder left in, no error) |
| Missing variable, LangChain f-string `format(name=...)` only | `KeyError: 'order_id'` |
| Literal JSON `{"status": "ok"}` in a Langfuse prompt, `compile()` | Kept as is |
| Same prompt via `get_langchain_prompt()` | Braces escaped to `{{"status": "ok"}}`; LangChain `format()` then gives the right text |
| Literal JSON in a single-brace f-string template, LangChain `format()` | `KeyError: '"status"'` |

Docs read 30 Oct 2026: LangSmith "Prompt template format guide" (f-string `{variable}` and mustache `{{variable}}`; in f-string, `{{` is an escaped literal brace) and Langfuse "Variables in prompts" (`{{variable}}`, `.compile()`, `get_langchain_prompt()`).

Files: prompt_syntax.py (the script), run.txt (raw output, ends with EXIT_CODE).
