typetext
{
"images": [
"https://replicate.delivery/pbxt/Ma2T6ufUKuLsiP3VzC9r1owPT0ObFQ4LTgG6f7LJ6Shg0Aez/australia.jpg"
],
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant.",
"temperature": 0.7,
"text": "What is shown in this image?"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yvz**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run microsoft/phi-4-multimodal-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"microsoft/phi-4-multimodal-instruct:40c8f5c03ce250441855e776528bafd11cdb302c6677613acc0942c58dbd0afa",
{
input: {
images: ["https://replicate.delivery/pbxt/Ma2T6ufUKuLsiP3VzC9r1owPT0ObFQ4LTgG6f7LJ6Shg0Aez/australia.jpg"],
max_tokens: 1000,
system_prompt: "You are a helpful assistant.",
temperature: 0.7,
text: "What is shown in this image?"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yvz**********************************
This is your API token. Keep it to yourself.
import replicate
Run microsoft/phi-4-multimodal-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"microsoft/phi-4-multimodal-instruct:40c8f5c03ce250441855e776528bafd11cdb302c6677613acc0942c58dbd0afa",
input={
"images": ["https://replicate.delivery/pbxt/Ma2T6ufUKuLsiP3VzC9r1owPT0ObFQ4LTgG6f7LJ6Shg0Aez/australia.jpg"],
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant.",
"temperature": 0.7,
"text": "What is shown in this image?"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yvz**********************************
This is your API token. Keep it to yourself.
Run microsoft/phi-4-multimodal-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "microsoft/phi-4-multimodal-instruct:40c8f5c03ce250441855e776528bafd11cdb302c6677613acc0942c58dbd0afa",
"input": {
"images": ["https://replicate.delivery/pbxt/Ma2T6ufUKuLsiP3VzC9r1owPT0ObFQ4LTgG6f7LJ6Shg0Aez/australia.jpg"],
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant.",
"temperature": 0.7,
"text": "What is shown in this image?"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
A stop sign in front of a building with Chinese writing on it.
{
"id": "qc7k89h1rhrm80cn9v8avyje44",
"model": "microsoft/phi-4-multimodal-instruct",
"version": "40c8f5c03ce250441855e776528bafd11cdb302c6677613acc0942c58dbd0afa",
"input": {
"images": [
"https://replicate.delivery/pbxt/Ma2T6ufUKuLsiP3VzC9r1owPT0ObFQ4LTgG6f7LJ6Shg0Aez/australia.jpg"
],
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant.",
"temperature": 0.7,
"text": "What is shown in this image?"
},
"logs": "/root/.pyenv/versions/3.12.6/lib/python3.12/site-packages/transformers/generation/configuration_utils.py:628: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.7` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed.\nwarnings.warn(\n/root/.pyenv/versions/3.12.6/lib/python3.12/site-packages/transformers/generation/configuration_utils.py:628: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.7` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`.\nwarnings.warn(",
"output": "A stop sign in front of a building with Chinese writing on it.",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-28T23:06:57.86Z",
"started_at": "2025-02-28T23:08:46.214687Z",
"completed_at": "2025-02-28T23:08:47.517339Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/qc7k89h1rhrm80cn9v8avyje44/cancel",
"get": "https://api.replicate.com/v1/predictions/qc7k89h1rhrm80cn9v8avyje44",
"web": "https://replicate.com/p/qc7k89h1rhrm80cn9v8avyje44"
},
"metrics": {
"predict_time": 1.302652543,
"total_time": 109.657339
}
}