Guillaume Nodet created CAMEL-23728:
---------------------------------------

             Summary: camel-jbang - camel ask returns 404 when using Vertex AI 
endpoint
                 Key: CAMEL-23728
                 URL: https://issues.apache.org/jira/browse/CAMEL-23728
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
            Reporter: Guillaume Nodet
             Fix For: 4.x


When using `camel ask` through Google Cloud Vertex AI, the LLM client sends the 
model name as-is (e.g., `claude-sonnet-4-6`) in the Vertex AI URL path:

{code}
/v1/projects/<project>/locations/global/publishers/anthropic/models/claude-sonnet-4-6:rawPredict
{code}

This returns a 404 because Vertex AI expects a versioned model identifier 
(e.g., `claude-sonnet-4-6@20250514`).

The HTML error response from Google is dumped directly to the terminal:
{code}
LLM returned status: 404
<!DOCTYPE html>
<html lang=en>
...
<p><b>404.</b> <ins>That's an error.</ins>
<p>The requested URL <code>/.../models/claude-sonnet-4-6:rawPredict</code> was 
not found on this server.
{code}

Two issues:
1. *Model name mapping* — LlmClient should map model names to Vertex 
AI-compatible identifiers when the endpoint is a Vertex AI URL
2. *Error handling* — Non-JSON error responses (like HTML 404 pages) should be 
parsed gracefully instead of dumping raw HTML to the user

*Workaround*: Use the Anthropic API directly with `--api-type=anthropic 
--api-key=$ANTHROPIC_API_KEY`



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to