Packages

vLLM for Elixir via SnakeBridge - Easy, fast, and cheap LLM serving for everyone. High-throughput LLM inference with PagedAttention, continuous batching, and OpenAI-compatible API.

Current section

Files

Jump to
vllm lib snakebridge_generated vllm platforms __init__.ex
Raw

lib/snakebridge_generated/vllm/platforms/__init__.ex

# Generated by SnakeBridge v0.15.0 - DO NOT EDIT MANUALLY
# Regenerate with: mix compile
# Library: vllm 0.14.0
# Python module: vllm.platforms
defmodule Vllm.Platforms do
@moduledoc """
Submodule bindings for `vllm.platforms`.
## Version
- Requested: 0.14.0
- Observed at generation: 0.14.0
## Runtime Options
All functions accept a `__runtime__` option for controlling execution behavior:
Vllm.Platforms.some_function(args, __runtime__: [timeout: 120_000])
### Supported runtime options
- `:timeout` - Call timeout in milliseconds (default: 120,000ms / 2 minutes)
- `:timeout_profile` - Use a named profile (`:default`, `:ml_inference`, `:batch_job`, `:streaming`)
- `:stream_timeout` - Timeout for streaming operations (default: 1,800,000ms / 30 minutes)
- `:session_id` - Override the session ID for this call
- `:pool_name` - Target a specific Snakepit pool (multi-pool setups)
- `:affinity` - Override session affinity (`:hint`, `:strict_queue`, `:strict_fail_fast`)
### Timeout Profiles
- `:default` - 2 minute timeout for regular calls
- `:ml_inference` - 10 minute timeout for ML/LLM workloads
- `:batch_job` - Unlimited timeout for long-running jobs
- `:streaming` - 2 minute timeout, 30 minute stream_timeout
### Example with timeout override
# For a long-running ML inference call
Vllm.Platforms.predict(data, __runtime__: [timeout_profile: :ml_inference])
# Or explicit timeout
Vllm.Platforms.predict(data, __runtime__: [timeout: 600_000])
# Route to a pool and enforce strict affinity
Vllm.Platforms.predict(data, __runtime__: [pool_name: :strict_pool, affinity: :strict_queue])
See `SnakeBridge.Defaults` for global timeout configuration.
"""
@doc false
def __snakebridge_python_name__, do: "vllm.platforms"
@doc false
def __snakebridge_library__, do: "vllm"
@doc """
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list.
The argument must be an iterable if specified.
## Returns
- `list(term())`
"""
@spec __all__() :: {:ok, list(term())} | {:error, Snakepit.Error.t()}
def __all__() do
SnakeBridge.Runtime.get_module_attr(__MODULE__, :__all__)
end
@doc """
Python binding for `vllm.platforms.__getattr__`.
## Parameters
- `name` (String.t())
## Returns
- `term()`
"""
@spec __getattr__(String.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def __getattr__(name, opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :__getattr__, [name], opts)
end
@doc """
Python binding for `vllm.platforms.__setattr__`.
## Parameters
- `name` (String.t())
- `value` (term())
## Returns
- `term()`
"""
@spec __setattr__(String.t(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def __setattr__(name, value, opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :__setattr__, [name, value], opts)
end
@doc """
Python binding for `vllm.platforms._current_platform`.
## Returns
- `term()`
"""
@spec _current_platform() :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), term()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), term(), term()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), term(), term(), term()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), term(), term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(term(), term(), term(), term(), term(), term(), term(), term()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@spec _current_platform(
term(),
term(),
term(),
term(),
term(),
term(),
term(),
term(),
keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def _current_platform() do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [], [])
end
def _current_platform(opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [], opts)
end
def _current_platform(arg1) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1], [])
end
def _current_platform(arg1, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1], opts)
end
def _current_platform(arg1, arg2) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2], [])
end
def _current_platform(arg1, arg2, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2], opts)
end
def _current_platform(arg1, arg2, arg3) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2, arg3], [])
end
def _current_platform(arg1, arg2, arg3, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2, arg3], opts)
end
def _current_platform(arg1, arg2, arg3, arg4) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2, arg3, arg4], [])
end
def _current_platform(arg1, arg2, arg3, arg4, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2, arg3, arg4], opts)
end
def _current_platform(arg1, arg2, arg3, arg4, arg5) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2, arg3, arg4, arg5], [])
end
def _current_platform(arg1, arg2, arg3, arg4, arg5, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :_current_platform, [arg1, arg2, arg3, arg4, arg5], opts)
end
def _current_platform(arg1, arg2, arg3, arg4, arg5, arg6) do
SnakeBridge.Runtime.call(
__MODULE__,
:_current_platform,
[arg1, arg2, arg3, arg4, arg5, arg6],
[]
)
end
def _current_platform(arg1, arg2, arg3, arg4, arg5, arg6, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(
__MODULE__,
:_current_platform,
[arg1, arg2, arg3, arg4, arg5, arg6],
opts
)
end
def _current_platform(arg1, arg2, arg3, arg4, arg5, arg6, arg7) do
SnakeBridge.Runtime.call(
__MODULE__,
:_current_platform,
[arg1, arg2, arg3, arg4, arg5, arg6, arg7],
[]
)
end
def _current_platform(arg1, arg2, arg3, arg4, arg5, arg6, arg7, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(
__MODULE__,
:_current_platform,
[arg1, arg2, arg3, arg4, arg5, arg6, arg7],
opts
)
end
def _current_platform(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) do
SnakeBridge.Runtime.call(
__MODULE__,
:_current_platform,
[arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8],
[]
)
end
def _current_platform(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(
__MODULE__,
:_current_platform,
[arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8],
opts
)
end
@doc """
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or
errors is specified, then the object must expose a data buffer
that will be decoded using the given encoding and error handler.
Otherwise, returns the result of object.__str__() (if defined)
or repr(object).
encoding defaults to sys.getdefaultencoding().
errors defaults to 'strict'.
## Returns
- `String.t()`
"""
@spec _init_trace() :: {:ok, String.t()} | {:error, Snakepit.Error.t()}
def _init_trace() do
SnakeBridge.Runtime.get_module_attr(__MODULE__, :_init_trace)
end
@doc """
dict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
d = {}
for k, v in iterable:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
## Returns
- `%{optional(term()) => term()}`
"""
@spec builtin_platform_plugins() ::
{:ok, %{optional(term()) => term()}} | {:error, Snakepit.Error.t()}
def builtin_platform_plugins() do
SnakeBridge.Runtime.get_module_attr(__MODULE__, :builtin_platform_plugins)
end
@doc """
Python binding for `vllm.platforms.cpu_platform_plugin`.
## Returns
- `term()`
"""
@spec cpu_platform_plugin(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def cpu_platform_plugin(opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :cpu_platform_plugin, [], opts)
end
@doc """
Python binding for `vllm.platforms.cuda_platform_plugin`.
## Returns
- `term()`
"""
@spec cuda_platform_plugin(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def cuda_platform_plugin(opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :cuda_platform_plugin, [], opts)
end
@doc """
Python module attribute `vllm.platforms.current_platform`.
## Returns
- `term()`
"""
@spec current_platform() :: {:ok, term()} | {:error, Snakepit.Error.t()}
def current_platform() do
SnakeBridge.Runtime.get_module_attr(__MODULE__, :current_platform)
end
@doc """
Python binding for `vllm.platforms.load_plugins_by_group`.
## Parameters
- `group` (String.t())
## Returns
- `%{optional(String.t()) => term()}`
"""
@spec load_plugins_by_group(String.t(), keyword()) ::
{:ok, %{optional(String.t()) => term()}} | {:error, Snakepit.Error.t()}
def load_plugins_by_group(group, opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :load_plugins_by_group, [group], opts)
end
@doc """
Instances of the Logger class represent a single logging channel. A
"logging channel" indicates an area of an application. Exactly how an
"area" is defined is up to the application developer. Since an
application can have any number of areas, logging channels are identified
by a unique string. Application areas can be nested (e.g. an area
of "input processing" might include sub-areas "read CSV files", "read
XLS files" and "read Gnumeric files"). To cater for this natural nesting,
channel names are organized into a namespace hierarchy where levels are
separated by periods, much like the Java or Python package namespace. So
in the instance given above, channel names might be "input" for the upper
level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels.
There is no arbitrary limit to the depth of nesting.
## Returns
- `term()`
"""
@spec logger() :: {:ok, term()} | {:error, Snakepit.Error.t()}
def logger() do
SnakeBridge.Runtime.get_module_attr(__MODULE__, :logger)
end
@doc """
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or
errors is specified, then the object must expose a data buffer
that will be decoded using the given encoding and error handler.
Otherwise, returns the result of object.__str__() (if defined)
or repr(object).
encoding defaults to sys.getdefaultencoding().
errors defaults to 'strict'.
## Returns
- `String.t()`
"""
@spec platform_plugins_group() :: {:ok, String.t()} | {:error, Snakepit.Error.t()}
def platform_plugins_group() do
SnakeBridge.Runtime.get_module_attr(__MODULE__, "PLATFORM_PLUGINS_GROUP")
end
@doc """
Python binding for `vllm.platforms.resolve_current_platform_cls_qualname`.
## Returns
- `String.t()`
"""
@spec resolve_current_platform_cls_qualname(keyword()) ::
{:ok, String.t()} | {:error, Snakepit.Error.t()}
def resolve_current_platform_cls_qualname(opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :resolve_current_platform_cls_qualname, [], opts)
end
@doc """
Resolve an object by its fully-qualified class name.
## Parameters
- `qualname` (String.t())
## Returns
- `term()`
"""
@spec resolve_obj_by_qualname(String.t(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def resolve_obj_by_qualname(qualname, opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :resolve_obj_by_qualname, [qualname], opts)
end
@doc """
Python binding for `vllm.platforms.rocm_platform_plugin`.
## Returns
- `term()`
"""
@spec rocm_platform_plugin(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def rocm_platform_plugin(opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :rocm_platform_plugin, [], opts)
end
@doc """
Python binding for `vllm.platforms.supports_xccl`.
## Returns
- `boolean()`
"""
@spec supports_xccl(keyword()) :: {:ok, boolean()} | {:error, Snakepit.Error.t()}
def supports_xccl(opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :supports_xccl, [], opts)
end
@doc """
Python binding for `vllm.platforms.tpu_platform_plugin`.
## Returns
- `term()`
"""
@spec tpu_platform_plugin(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def tpu_platform_plugin(opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :tpu_platform_plugin, [], opts)
end
@doc """
Check to see if the vLLM version matches a substring.
## Parameters
- `substr` (String.t())
## Returns
- `boolean()`
"""
@spec vllm_version_matches_substr(String.t(), keyword()) ::
{:ok, boolean()} | {:error, Snakepit.Error.t()}
def vllm_version_matches_substr(substr, opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :vllm_version_matches_substr, [substr], opts)
end
@doc """
Python binding for `vllm.platforms.xpu_platform_plugin`.
## Returns
- `term()`
"""
@spec xpu_platform_plugin(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def xpu_platform_plugin(opts \\ []) do
SnakeBridge.Runtime.call(__MODULE__, :xpu_platform_plugin, [], opts)
end
end