# Best Practices Source: https://docs.tokenfactory.nebius.com/ai-models-inference/dedicated-endpoints/best-practice ## Common strategy on setting up deployment * **GPU type + GPU count** = performance per replica * **Replicas** = traffic capacity and availability Start with the smallest setup that reliably meets baseline needs, then scale deliberately based on real traffic and observability: *** ## Choosing performance setup: GPU types & GPUs per replica Choosing the right dedicated endpoint configuration depends on your workload’s priorities: latency, throughput, model size, and cost efficiency. ### GPU type GPU type determines the performance profile of each replica, including memory capacity, throughput, and cost. In general: | Higher-end GPUs | Mid-range GPUs | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | | | **Rule of thumb:** Choose the smallest GPU type that supports your model and region. If performance is insufficient, first scale GPU type or GPUs per replica before aggressively increasing replicas. ### GPUs per replica (`gpu_count`) `gpu_count` defines how many GPUs power a single replica. This primarily affects: * Per-request latency * Maximum throughput per replica * Ability to serve larger or more demanding workloads | Lower GPU count per replica | Higher GPU count per replica | | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | | | **Rule of thumb:** Start small when you are testing traffic, usage is uncertain, internal deployment, cost control matters. Scale up when requests are latency-sensitive, individual replicas saturate, you need stronger single-endpoint performance Avoid Over-relying on replicas to solve underpowered replicas. More replicas help concurrency, but they do not fix poor per-request latency caused by insufficient GPU resources. *** ## Choosing number of replicas Replicas determine how much baseline and burst traffic your deployment can handle. ### Min replicas: guaranteed baseline capacity Minimum replicas are always allocated while the endpoint is active. Use higher `min_replicas` when: * You need predictable low latency * Traffic is steady * Cold starts are unacceptable * Capacity predictability matters Use lower `min_replicas` when: * Traffic is irregular * You optimize for cost * Batch or internal workloads * Occasional warm-up is acceptable ### Max replicas: burst scaling ceiling Maximum replicas define how far autoscaling can expand if capacity is available. Use higher `max_replicas` when: * Traffic spikes significantly * Usage is unpredictable * You need burst headroom Use lower `max_replicas` when: * Workload is stable * Budget control matters * Capacity is predictable **Rule of thumb:** * min\_replicas - what you always need * max\_replicas - what you may need during peaks **Note that:** * Min replicas are guaranteed while active. If you stop the endpoint the reservation will be freed up. * Max replicas scaling depends on available capacity and may not always be continuously available after scale-down. [Read more in Capacity section](/ai-models-inference/dedicated-endpoints/capacity-and-scaling) # Billing Policy Source: https://docs.tokenfactory.nebius.com/ai-models-inference/dedicated-endpoints/billing-policy ### Billing while active * A dedicated endpoint is considered **active, accessible, and billable** when **at least one replica is running** * When **one or more replicas are running**, the endpoint is available to serve traffic and billing charges apply. * When **zero replicas are running**, the endpoint is not accessible and billing charges do not apply. * Charges may vary depending on your custom contract or work order. ### Autoscaling costs Scaling above or below minimum replicas adjusts billing dynamically on a PAYG basis. ### Capacity retention As long as your endpoint remains active, minimum replicas remain allocated to you. Once capacity is released, it may be reassigned and may not be immediately available again. ### Specific cases | Lifecycle step | Billing | | ------------------------------------------------------ | ----------- | | Capacity provisioning, `not ready` , `partially ready` | Not billed | | Capacity provisioned to the endpoint,`ready` status | Billed | | Replica restarts | Not billied | | Graceful shutdown for rolling update, endpoint stop | Not billed | # Capacity, availability, and service guarantees Source: https://docs.tokenfactory.nebius.com/ai-models-inference/dedicated-endpoints/capacity-and-scaling ### Capacity availability Dedicated endpoint deployment depends on available capacity across different regions. Not all listed GPU types may be available at all times. Availability depends on current regional capacity. ### Capacity after stops, incidents, and maintenance Self-service dedicated endpoints are provisioned on Nebius AI Cloud on-demand (pay-as-you-go) capacity. This capacity is drawn from a shared pool and is allocated to your endpoint only while it is active — **it is not a long-term reservation, and the minimum replicas guarantee applies only while the endpoint is running.** **When an endpoint stops, its GPU capacity is released back to the shared pool. This applies regardless of why the endpoint stopped**: * You stop the endpoint manually * The endpoint is interrupted by an incident * The endpoint is stopped for scheduled or emergency maintenance When the endpoint starts again, capacity is requested from the pool anew and allocated based on availability at that moment. There is no mechanism that holds your previous GPUs for the endpoint or returns them after an interruption. As a result: * After a restart, the endpoint may stay in **Starting / Not ready**, or reach only **Partially ready**, until sufficient capacity becomes available. See [Lifecycle & Readiness Status](/ai-models-inference/dedicated-endpoints/lifecycle-and-status). * During periods of high demand, or for scarce GPU types, restarting may take significantly longer than the initial deployment, and capacity may be temporarily unavailable. This is the standard behavior of on-demand capacity in Nebius AI Cloud, on which self-service dedicated endpoints run: without a reservation, GPU resources are taken from a shared pool and returned to it when they stop — whether stopped by you or by a maintenance event — and recovery after maintenance or an incident does not restore the capacity your endpoint used before. For details on how on-demand and reserved capacity work, see [Capacity reservations for Compute virtual machines](https://docs.nebius.com/compute/virtual-machines/reservations) in the Nebius AI Cloud documentation. If your workload requires guaranteed capacity across restarts, incidents, and maintenance windows, [contact our Sales team to reserve dedicated GPU capacity](https://nebius.com/services/token-factory/enterprise-grade-inference#token-factory-enterprise-sales-form) ### Minimum replicas guarantee Minimum replicas are reserved and non-preemptible and remain allocated to your deployment for as long as the endpoint is active. If the endpoint stops for any reason, this allocation is released — see the section above. ### Maximum replicas scaling Scaling above minimum replicas depends on available burst capacity and is not guaranteed indefinitely. Additional replicas may be reclaimed after scale-down and may not always be available again without sufficient capacity. ### SLA Self-service dedicated endpoints do not include a formal SLA unless covered by contract. Historical average monthly request success rate has been approximately 99.9%. If you encounter capacity errors or are unable to scale beyond the minimum number of replicas, [contact our Sales team to reserve dedicated GPU capacity](https://nebius.com/services/token-factory/enterprise-grade-inference?_gl=1*b0acui*_gcl_au*MTAwNTQwNDk0NC4xNzcwMjkyMzc3LjExODU3MTgzMTAuMTc3NjA5NDQ4Ni4xNzc2MDk0NDg1#token-factory-enterprise-sales-form) # Control & Data Plane Source: https://docs.tokenfactory.nebius.com/ai-models-inference/dedicated-endpoints/control-data-plane ## Terminology | **Term** | **Description** | | :---------------- | :----------------------------------------------------------------------------------------------------------------------------- | | **Template** | A deployable performance “blueprint” for a model. Templates define which `flavor_name`, `gpu_type`, and regions are supported. | | **Flavor** | A template's sub-option (e.g. `base`, `fast`) with different performance/throughput/costs characteristics. | | **Endpoint** | Dedicated deployment with API access | | **endpoint\_id** | Identifier used for update/delete operations. | | **routing\_key** | The model identifier you pass to inference calls. Returned when you create an endpoint. | | **Control plane** | Sets up the configuration and settings of your endpoints. Has common base URL API. | | **Data plane** | Processes model inference requests. Has regional base URL API. | ## Control plane Dedicated Endpoints Control Plane is a managedment layer for all configurations operations: * Creating & updating endpoints * Uploading models / weights * Scaling configs (min/max replicas) * Monitoring setup Use common base URL API for all dedicated endpoint management operations: ```text theme={null} https://api.tokenfactory.nebius.com ``` ## Data plane Dedicated Ednpoints Data Plane processes model inference requests. It has regional base URL API. Region impacts latency, data locality, and regulatory compliance. Use a region-appropriate base URL for your inference calls: | Endpoint region | Inference base URL | | :-------------- | :------------------------------------------------ | | `eu-north1` | `https://api.tokenfactory.nebius.com` | | `eu-west1` | `https://api.tokenfactory.eu-west1.nebius.com` | | `us-central1` | `https://api.tokenfactory.us-central1.nebius.com` | Using the respective inference base URL avoids unnecessary global routing and reduces round-trip latency. ## Endpoint Observability Check out Observability Documentation section here # Custom model weights Source: https://docs.tokenfactory.nebius.com/ai-models-inference/dedicated-endpoints/custom-weights **Working with custom model weights** is currently in beta and available on request. If you’d like to deploy or work with custom fine-tuned model weights, [please contact our Support team to enable access](https://tokenfactory.nebius.com/?modals=contact-us) and guide you through the current setup process. Availability, supported configurations, and onboarding steps may vary during the beta period. # Quickstart: Deploy via API Source: https://docs.tokenfactory.nebius.com/ai-models-inference/dedicated-endpoints/deploy-api ## Overview Deploying a dedicated endpoint via API takes three steps: 1. List available model templates 2. Create a dedicated endpoint 3. Send inference requests For updating, listing, and deleting endpoints, see **Operating dedicated endpoints**. ## List model templates List model templates that can be used to create a dedicated endpoint. ```http theme={null} GET /v0/dedicated_endpoints/templates ``` ```python Python theme={null} import os, json, requests CONTROL_PLANE_BASE_URL = "https://api.tokenfactory.nebius.com" API_TOKEN = os.environ["API_TOKEN"] r = requests.get( f"{CONTROL_PLANE_BASE_URL}/v0/dedicated_endpoints/templates", headers={"Authorization": f"Bearer {API_TOKEN}"}, ) r.raise_for_status() print(json.dumps(r.json(), indent=2)) ``` ```shellscript cURL theme={null} curl -sS \ -H "Authorization: Bearer $API_TOKEN" \ "https://api.tokenfactory.nebius.com/v0/dedicated_endpoints/templates" ``` Use the template response as the source of truth for valid combinations of `model_name`, `flavor_name`, `gpu_type`, `gpu_count` and `region`. ## Create dedicated endpoint Create a dedicated endpoint from one of the available model templates. ```http theme={null} POST /v0/dedicated_endpoints ``` ```python Python theme={null} import os, json, requests CONTROL_PLANE_BASE_URL = "https://api.tokenfactory.nebius.com" API_TOKEN = os.environ["API_TOKEN"] payload = { "name": "GPT-20B Endpoint", "description": "Dedicated GPT-20B for internal apps", "model_name": "openai/gpt-oss-20b", "flavor_name": "base", "gpu_type": "gpu-h100-sxm", "gpu_count": 1, "region": "eu-north1", "scaling": {"min_replicas": 1, "max_replicas": 2}, } r = requests.post( f"{CONTROL_PLANE_BASE_URL}/v0/dedicated_endpoints", headers={"Authorization": f"Bearer {API_TOKEN}"}, json=payload, ) r.raise_for_status() print(json.dumps(r.json(), indent=2)) ``` ```shellscript cURL theme={null} curl -sS -X POST \ "https://api.tokenfactory.nebius.com/v0/dedicated_endpoints" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "GPT-20B Endpoint", "description": "Dedicated GPT-20B for internal apps", "model_name": "openai/gpt-oss-20b", "flavor_name": "base", "gpu_type": "gpu-h100-sxm", "gpu_count": 1, "region": "eu-north1", "scaling": { "min_replicas": 1, "max_replicas": 2 } }' ``` The response includes endpoint metadata, including: * `endpoint_id` * `routing_key` Use `endpoint_id` to manage the endpoint through the control plane. Use `routing_key` as the model identifier when sending inference requests to the data plane. Initial deployment can take several minutes. While provisioning, inference may fail (often `404`) until the endpoint is routable. ## Send inference requests Once the endpoint is ready, send requests to the OpenAI-compatible data plane under `/v1`. Use the `routing_key` returned by the control plane as the `model` value in inference requests: ```text theme={null} model = "" ``` Use a region-appropriate base URL for your inference calls. Example request URL: ```text theme={null} https://api.tokenfactory.us-central1.nebius.com/v1/chat/completions ``` ```python Python (OpenAI SDK) theme={null} import os from openai import OpenAI API_TOKEN = os.environ["API_TOKEN"] # Choose based on the endpoint region INFERENCE_BASE_URL = "https://api.tokenfactory.us-central1.nebius.com/v1" client = OpenAI( base_url=INFERENCE_BASE_URL, api_key=API_TOKEN, ) routing_key = "" # use exactly what the API returned response = client.chat.completions.create( model=routing_key, messages=[{"role": "user", "content": "Explain the difference between LLM fine-tuning and RAG."}], ) print(response.choices[0].message.content) ``` ```shellscript cURL theme={null} curl -sS "https://api.tokenfactory.us-central1.nebius.com/v1/chat/completions" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "", "messages": [ { "role": "user", "content": "Hello from my dedicated endpoint!" } ] }' ``` We expose OpenAI-compatible inference routes under `/v1`. Template availability determines what kinds of models you can deploy (today, publicly available templates are primarily chat-capable). # Quickstart: Deploy in UI Source: https://docs.tokenfactory.nebius.com/ai-models-inference/dedicated-endpoints/deploy-ui Dedicated endpoints can be deployed and managed through the Token Factory UI, with API workflows also available for automation. You can create a dedicated endpoint from either of these UI locations: * Explore page: [https://tokenfactory.nebius.com/](https://tokenfactory.nebius.com/) * Inference → Model Endpoints: [https://tokenfactory.nebius.com/endpoints](https://tokenfactory.nebius.com/endpoints) Image Image 1. Explore page [https://tokenfactory.nebius.com/](https://tokenfactory.nebius.com/) 2. Inference/Model Endpoints [https://tokenfactory.nebius.com/endpoints](https://tokenfactory.nebius.com/endpoints) From there, select a supported model template and complete the deployment configuration, including region, GPU configuration, and autoscaling settings. Image Image Image ## Walkthrough on UI deployment