Obscura.Recognizer.GLiNER.Native (obscura v0.1.0)

Copy Markdown View Source

Experimental native Nx/Emily serving for the pinned Urchade GLiNER model.

This adapter requires an explicit local Safetensors export and never downloads model assets. Both Emily backend fallback and compiler fallback are forced to :raise, so successful inference is evidence of native execution rather than silent evaluator or BinaryBackend fallback.

Summary

Functions

Builds a strict Emily GPU serving from a local native Urchade export.

Runs native GLiNER inference for one text.

Runs native GLiNER inference for multiple texts while reusing one serving.

Types

t()

@type t() :: %Obscura.Recognizer.GLiNER.Native{
  backend: term(),
  compiled: term(),
  compiler: term(),
  config: term(),
  metadata: term(),
  model_spec: term(),
  params: term(),
  paths: term(),
  shape_buckets: term(),
  tokenizer: term(),
  trace_compiled: term()
}

Functions

build(opts \\ [])

@spec build(keyword()) :: {:ok, t()} | {:error, term()}

Builds a strict Emily GPU serving from a local native Urchade export.

run(serving, text, opts \\ [])

@spec run(t(), String.t(), keyword()) :: {:ok, [map()]} | {:error, term()}

Runs native GLiNER inference for one text.

run_many(serving, texts, opts \\ [])

@spec run_many(t(), [String.t()], keyword()) :: {:ok, [[map()]]} | {:error, term()}

Runs native GLiNER inference for multiple texts while reusing one serving.