> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adaptive-ml.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Models

> Deploy and run inference on models in Adaptive

Models power your AI applications. Attach a model to a use case to deploy it and make it available for inference.

> [tab] SDK
>
> ## Deploy a model
>
> ```python theme={null}
> adaptive.models.attach(
>     model="llama-3.1-8b-instruct",
>     wait=True,
> )
> ```
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | `model` | str | Yes | Model key from the registry |
> | `wait` | bool | No | Block until model is online (default: False) |
> | `make_default` | bool | No | Set as default model for the use case |
>
> The model becomes available within a few minutes. Adaptive supports most transformer-based models including Llama, Qwen, Gemma, Mistral, and DeepSeek. See [Integrations](https://docs.adaptive-ml.com/v0.11/advanced/integrations.md) for proprietary models.
>
> ## Run inference
>
> ```python theme={null}
> response = adaptive.chat.create(
>     model="llama-3.1-8b-instruct",
>     messages=[
>         {"role": "system", "content": "You are a helpful assistant."},
>         {"role": "user", "content": "Hello!"}
>     ],
>     labels={"project": "my-app"},
> )
> print(response.choices[0].message.content)
>
> # Get completion_id for feedback
> completion_id = response.choices[0].completion_id
> ```
>
> Requests are logged automatically. Use `labels` to organize and filter interactions. See [Interactions](https://docs.adaptive-ml.com/v0.11/core/interactions.md) for details.
>
> If you omit `model`, requests route to the use case's default model.
>
> ```python theme={null}
> # Streaming
> stream = adaptive.chat.create(
>     messages=[{"role": "user", "content": "Hello!"}],
>     stream=True,
> )
> for chunk in stream:
>     if chunk.choices:
>         print(chunk.choices[0].delta.content, end="", flush=True)
> ```
>
> > [accordion] OpenAI compatibility
> >
> > Use the OpenAI Python library with your Adaptive deployment:
> >
> > ```python theme={null}
> > from openai import OpenAI
> >
> > client = OpenAI(
> >     base_url=f"{ADAPTIVE_URL}/api/v1",
> >     api_key=ADAPTIVE_API_KEY,
> > )
> >
> > response = client.chat.completions.create(
> >     model="use_case_key/model_key",
> >     messages=[{"role": "user", "content": "Hello!"}],
> > )
> > ```
> >
> > Set `model` to `use_case_key/model_key`. Use `metadata` instead of `labels`.
>
> See [SDK Reference](https://docs.adaptive-ml.com/v0.11/reference/sdk.md) for all model and chat methods.

> [tab] UI
>
> ## Deploy a model
>
> ![](https://mintcdn.com/adaptiveml/R5QotOduSKbjj2fS/static/models-0-11.png?fit=max\&auto=format\&n=R5QotOduSKbjj2fS\&q=85\&s=b4f4be7b06f9d45f1c117c1f6155c8f4)
>
> The Models page lists all models in your registry
>
> Navigate to your use case and open the **Models** tab. Click **Attach Model** and select from the registry.
>
> ![](https://mintcdn.com/adaptiveml/R5QotOduSKbjj2fS/static/lora_indents-0-11.png?fit=max\&auto=format\&n=R5QotOduSKbjj2fS\&q=85\&s=949e681d4feb4fa060150e9a754fdb5b)
>
> Adapters appear indented under their backbone model
>
> Fine-tuned adapter models appear indented under their base model.
>
> ## Run inference
>
> Open your use case and click **Chat** to interact with deployed models directly in the browser.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.