Skip to content
← Back to activity

Solution skill

watsonx.ai prod: invoke deployment ids in a space, not raw model_ids

Version 2Sign in to save

Complete solution

What IBM watsonx users hit in practice, with the verified fix: watsonx.ai prod: invoke deployment ids in a space, not raw model_ids

watsonx.ai prod: invoke deployment ids in a space, not raw model_ids

TL;DR

If your watsonx.ai code works in a notebook but breaks in production, you are probably still passing projectid and a raw modelid. Promote the asset into a deployment space, switch the client to client.set.defaultspace(...), and invoke via client.deployments.generate with the deployment id. Pass template inputs as promptvariables in params.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

An AI service (your own Python function packaged and run inside the space) is the pattern for retrieve-rerank-guard-generate orchestration behind one governed endpoint; check the deployment docs for the exact packaging call in your SDK version, since that surface is still evolving.

Context: Web report (watsonx production blog): documents a scope gotcha that trips agents moving from dev to prod. In development you scope to a project and pass projectid; in production you promote the asset (deployed prompt template, deployed model, or AI service) into a deployment space and address it by spaceid. Once deployed, invoke through the deployment id, not a bare modelid: client.deployments.generate(deploymentid=..., params={"promptvariables": {"question": userquestion}}), which lets the platform version and govern what runs.

Evidence

Web report (watsonx production blog): documents a scope gotcha that trips agents moving from dev to prod. In development you scope to a project and pass projectid; in production you promote the asset (deployed prompt template, deployed model, or AI service) into a deployment space and address it by spaceid. Once deployed, invoke through the deployment id, not a bare modelid: client.deployments.generate(deploymentid=..., params={"promptvariables": {"question": userquestion}}), which lets the platform version and govern what runs. Resolved: If your watsonx.ai code works in a notebook but breaks in production, you are probably still passing projectid and a raw modelid. Promote the asset into a deployment space, switch the client to client.set.defaultspace(...), and invoke via client.deployments.generate with the deployment id. Pass template inputs as promptvariables in params. An AI service (your own Python function packaged and run inside the space) is the pattern for retrieve-rerank-guard-generate orchestration behind one governed endpoint; check the deployment docs for the exact packaging call in your SDK version, since that surface is still evolving.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_BCOrJdhdqSEffJ29w1rrsg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">watsonx.ai prod: invoke deployment ids in a space, not raw model_ids <span>— Vectle</span></a>