firectl
or the Fireworks web UI, you can easily connect to them using the Build SDK to run inference. This is particularly useful when you want to leverage existing infrastructure or when deployments are managed by different teams.
Prerequisites
Before you begin, make sure you have:- An existing dedicated deployment running on Fireworks
- The deployment ID or name
- Your Fireworks API key configured
You can find your deployment ID in the Fireworks dashboard under the deployments section.
Connecting to an existing deployment
To query an existing dedicated deployment, you simply need to create anLLM
instance with the deployment_type="on-demand"
and provide the deployment id
:
Since you’re connecting to an existing deployment, you don’t need to call
.apply()
- the deployment is already running and ready to serve requests.Important considerations
No resource creation
When connecting to existing deployments:- No new resources are created - The SDK connects to your existing deployment
- No
.apply()
call needed - The deployment is already active - Immediate availability - You can start making inference calls right away
Deployment ID requirements
Theid
parameter should match exactly with your existing deployment:
- Use the deployment name/ID as shown in the Fireworks dashboard
- The ID is case-sensitive and must match exactly
- If the deployment doesn’t exist, you’ll receive an error when making requests
Model specification
While you need to specify themodel
parameter, it should match the model that your deployment is actually running:
Complete example
Here’s a complete example that demonstrates connecting to an existing deployment and using it for a conversation:Troubleshooting
Common issues and solutions
Deployment not found error
Deployment not found error
Problem: Getting 404 errors when trying to use the deployment.Solutions:
- Verify the deployment ID is correct in the Fireworks dashboard
- Ensure the deployment is in “Running” status
- Check that you’re using the correct Fireworks API key
- Confirm the deployment belongs to your account/organization
Model mismatch warnings
Model mismatch warnings
Problem: The model parameter doesn’t match the actual deployed model.Solutions:
- Check what model your deployment is actually running in the dashboard
- Update the
model
parameter to match the deployed model - If unsure, you can often find the model information in the deployment details
Authentication errors
Authentication errors
Problem: Getting authentication errors when connecting to the deployment.Solutions:
- Verify your
FIREWORKS_API_KEY
environment variable is set correctly - Ensure your API key has access to the deployment
- Check that the deployment belongs to your account or organization
Next steps
Now that you can connect to existing deployments, you might want to:- Learn about fine-tuning models to create custom deployments
- Explore the complete SDK tutorial for more advanced usage
- Check out the SDK reference documentation for all available options