model in chat completions. For more deployment operations, see Deployments.
Deploy your fine-tuned model
Find your fine-tuning job ID
Endpoint:GET v1/flow/fine-tunes
List your fine-tuning jobs to find the ID of the completed job you want to deploy.
completed.
Check a specific job
Endpoint:GET v1/flow/fine-tunes/{fine_tune_id}
Retrieve a single job to confirm its status before you deploy it.
Create a deployment
Endpoint:POST v1/flow/deployments
Create a deployment that points at your fine-tuning job ID.
Pending status and becomes Active when it’s ready to serve requests. You don’t need to promote it.
Wait for the deployment to become active
Endpoint:GET v1/flow/deployments/{deployment_id}
Check the deployment status until it reaches Active.
model when you run inference.
Run inference
Stream chat completions
Send chat completion requests to test your model’s task or domain performance and get a sense of the end-user experience. Endpoint:POST v1/inference/chat/completions
For
model, you can use any supported base model or the ID of an active deployment.Configure request parameters
Adjust parameters such astemperature, max_tokens, top_p, and stop to control the model’s output. For every supported parameter and its allowed values, see Create chat completion.
Return token log probabilities during inference
You can also return the token log probabilities, or “logprobs”. Logprobs reveal the model’s certainty for each generated token. Low-confidence predictions highlight gaps in training data. During staging, you can flag outputs with low confidence (for example, strongly negative logprobs) for manual review or retraining. Unusually high logprobs for irrelevant tokens can signal hallucinations. During staging, this can help refine prompts or adjust temperature settings. Logprob requests follow the OpenAI convention:- To return the logprobs of the generated tokens, set
logprobs=True. - To also return the top n most likely tokens and their associated logprobs, set
top_logprobs=n, where n > 0.
Manage your deployment
Demote a deployment
Endpoint:PUT v1/flow/deployments/{deployment_id}/demote
When you’re done with the model, demote the deployment to stop serving requests. The deployment and its ID remain, and you can reactivate it later.
Pending before it reaches Inactive.
Reactivate a demoted deployment
Endpoint:PUT v1/flow/deployments/{deployment_id}/promote
To serve requests from a demoted deployment again, promote it. You can only promote a deployment in Inactive status. Promoting an Active deployment returns a 400 error.
Run validation checks
Before you use a deployed model in production, validate its performance to ensure a smooth transition. Make sure your model is ready for production deployment by running comprehensive validation checks.Prepare representative validation data
Start by curating diverse validation datasets that mirror real-world inputs, including edge cases and difficult examples your model encounters in production. Example: For a customer service chatbot handling clothing returns, include:- Simple queries (“How do I return this shirt?”)
- Complex scenarios (“I received the wrong size in a different color than ordered”)
- Edge cases (“I started a return but the tracking shows it’s still at my house”)
- Multi-intent queries (“I want to exchange this and add something to my order”)
Run comprehensive checks
Next, evaluate prediction quality and system performance to ensure all production requirements are satisfied.Track critical metrics
Statistics are a critical tool for making sure your AI is trustworthy. These commonly used metrics evaluate a model’s performance.Prediction quality metrics
In practice, there’s often a trade-off between minimizing false positives and false negatives. The relative cost of each error type helps determine whether to prioritize precision or recall when optimizing a model. The F1 score is specifically designed to balance the concerns of both, by combining precision and recall into a single metric.
Going back to the clothing returns chatbot, you might prioritize F1 score when the costs of incorrectly rejecting valid returns (customer dissatisfaction) and incorrectly accepting invalid returns (financial loss) are both significant concerns that need to be balanced.
System performance metrics
- Latency: Response time per prediction
- Throughput: Prediction volume capacity (for example, 1,000 requests per second)
Identify areas for improvement and iterate
Conduct an error analysis
Categorize and investigate patterns in incorrect predictions to identify underlying causes.Implement targeted improvements
Apply insights from error analysis to refine the model through iterative improvements:- Hyperparameter tuning
- Additional training data
- Model architecture modifications