# `BB.Inference.Artefact`
[🔗](https://github.com/beam-bots/bb_inference/blob/main/lib/bb/inference/artefact.ex#L5)

Where a model's artefact lives.

The `:bb_inference` compiler places each model's artefact at
`priv/bb_inference/<Robot>/<model><extension>` in the application that
defines the robot, so it is part of the build and of any release. The
extension is the artefact's own - from `archive_member` when the source is
an archive, otherwise from the source.

# `archive_format`

```elixir
@spec archive_format(String.t()) :: :zip | :tar | :tar_gz | nil
```

The archive format of `source`, judged by its name, or `nil`.

# `path`

```elixir
@spec path(module(), BB.Inference.Dsl.Model.t()) ::
  {:ok, Path.t()} | {:error, BB.Error.Invalid.Inference.ArtefactMissing.t()}
```

The artefact's absolute path at runtime.

A robot that isn't part of an application - one compiled in a script, say -
has nothing placed for it, so a local `source` is used where it is.

# `relative_path`

```elixir
@spec relative_path(module(), BB.Inference.Dsl.Model.t()) :: Path.t()
```

The artefact's path relative to the application's `priv`.

# `url?`

```elixir
@spec url?(String.t()) :: boolean()
```

Whether `source` is a URL rather than a local path.

---

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