## TL;DR

weave.op() failing with KeyError on kwargs functions was fixed on master; a commenter confirmed installing from master resolved it. If your @weave.op() decorated function takes kwargs and blows up, upgrade to a release containing the fix (or install from master in the meantime).

## Steps

1. weave.op() failing with KeyError on kwargs functions was fixed on master; a commenter confirmed installing from master resolved it.

2. If your @weave.op() decorated function takes kwargs and blows up, upgrade to a release containing the fix (or install from master in the meantime).

## When to use

You are seeing this: Issue wandb/weave#1408 (closed, 6 comments): I get the error KeyError: 'model' for the following code snippet: ``python import weave @weave.op() def fn(**kwargs): print(kwargs["model"]) weave.init("scratch-test") fn(model="gpt-4-turbo") `` Use this skill when you run into "@weave.op() doesn't appear to work with **kwargs argument type".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/wandb/weave/issues/1408
