Skip to content

RemoteProxyConfig

Base classes

Name Children Inherits
BaseModelConfig
llmling_models_config.configs
Base for model configurations.

⋔ Inheritance diagram

graph TD
  2396347572["configs.RemoteProxyConfig"]
  3497727833["configs.BaseModelConfig"]
  330168112["schema.Schema"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  3497727833 --> 2396347572
  330168112 --> 3497727833
  3879467795 --> 330168112
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseModelConfig

Configuration for remote model proxy.

Source code in src/llmling_models_config/configs.py
class RemoteProxyConfig(BaseModelConfig):
    """Configuration for remote model proxy."""

    model_config = ConfigDict(json_schema_extra={"x-doc-title": "Remote proxy model"})

    type: Literal["remote-proxy"] = Field(default="remote-proxy", init=False)
    """Type identifier for remote proxy model."""

    url: str = Field(
        default="ws://localhost:8000/v1/completion/stream",
        examples=[
            "ws://localhost:8000/v1/completion/stream",
            "wss://api.example.com/completion",
        ],
        title="WebSocket URL",
    )
    """WebSocket URL for connecting to the remote model service."""

    api_key: SecretStr | None = Field(default=None, title="API key", examples=["abc123"])
    """Optional API key for authentication."""

    def get_model(self) -> Any:
        from llmling_models.models.remote_model import RemoteProxyModel

        key = self.api_key.get_secret_value() if self.api_key else None
        return RemoteProxyModel(url=self.url, api_key=key)

api_key class-attribute instance-attribute

api_key: SecretStr | None = Field(default=None, title='API key', examples=['abc123'])

Optional API key for authentication.

type class-attribute instance-attribute

type: Literal['remote-proxy'] = Field(default='remote-proxy', init=False)

Type identifier for remote proxy model.

url class-attribute instance-attribute

url: str = Field(
    default="ws://localhost:8000/v1/completion/stream",
    examples=["ws://localhost:8000/v1/completion/stream", "wss://api.example.com/completion"],
    title="WebSocket URL",
)

WebSocket URL for connecting to the remote model service.

:fa-brands-github: Show source on GitHub