# `BB.Error.Invalid.Inference.CodecMismatch`
[🔗](https://github.com/beam-bots/bb_inference/blob/main/lib/bb/error/invalid/inference/codec_mismatch.ex#L5)

A model's codec doesn't fit the artefact the runtime loaded: it expects
inputs or outputs the model doesn't have.

`expected` is the codec's own account of what it needs; `found` is a
summary of the runtime's `BB.Inference.Description`.

# `t`

```elixir
@type t() :: %BB.Error.Invalid.Inference.CodecMismatch{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  codec: module(),
  expected: String.t(),
  found: String.t(),
  model: atom(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %BB.Error.Invalid.Inference.CodecMismatch{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  codec: term(),
  expected: term(),
  found: term(),
  model: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

Create an `Elixir.BB.Error.Invalid.Inference.CodecMismatch` without raising it.

## Keys

- :model
- :codec
- :expected
- :found

---

*Consult [api-reference.md](api-reference.md) for complete listing*
