typetext
{
"max_tokens": 512,
"prompt": "How many r in strawberry",
"temperature": 0.7,
"top_p": 0.95
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dzT**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lucataco/ollama-qwq using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/ollama-qwq:4bfc56cd5731ba68a0cbc95e40fe670b7780dd61f2c53e09411e4154f7a70207",
{
input: {
max_tokens: 512,
prompt: "How many r in strawberry",
temperature: 0.7,
top_p: 0.95
}
}
);
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_dzT**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/ollama-qwq using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/ollama-qwq:4bfc56cd5731ba68a0cbc95e40fe670b7780dd61f2c53e09411e4154f7a70207",
input={
"max_tokens": 512,
"prompt": "How many r in strawberry",
"temperature": 0.7,
"top_p": 0.95
}
)
# The lucataco/ollama-qwq model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/lucataco/ollama-qwq/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dzT**********************************
This is your API token. Keep it to yourself.
Run lucataco/ollama-qwq 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": "lucataco/ollama-qwq:4bfc56cd5731ba68a0cbc95e40fe670b7780dd61f2c53e09411e4154f7a70207",
"input": {
"max_tokens": 512,
"prompt": "How many r in strawberry",
"temperature": 0.7,
"top_p": 0.95
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Let's see... the word is "strawberry." I need to find out how many 'r's are in it. Okay, let's spell it out slowly: S-T-R-A-W-B-E-R-R-Y. I can see that there are two 'r's in the word. Wait, let me check again because sometimes letters can be tricky. S-T-R-A-W-B-E-R-R-Y. Yes, there's an 'r' after the s, then another one between e and y at the end. So that's two 'r's. I think that's correct. But just to be sure, maybe I should look it up or have someone else check it. But I'm pretty confident that there are two 'r's in "strawberry." Maybe I can count the letters one by one: S is 1, T is 2, R is 3, A is 4, W is 5, B is 6, E is 7, R is 8, R is 9, Y is 10. Wait, that says there are three 'r's. But earlier I thought there were only two. Hmm, maybe I miscounted. Let me do it again: S-T-R-A-W-B-E-R-R-Y. Okay, first 'r' is the third letter, then another one before the last letter, and another one before that. So yes, there are three 'r's. I don't know why I thought there were only two earlier. Maybe I skipped one. So, the correct answer is three 'r's in "strawberry." I should remember that for future reference.
{
"id": "z1v04rr8jhrm80cktb0bhdg9zg",
"model": "lucataco/ollama-qwq",
"version": "4bfc56cd5731ba68a0cbc95e40fe670b7780dd61f2c53e09411e4154f7a70207",
"input": {
"max_tokens": 512,
"prompt": "How many r in strawberry",
"temperature": 0.7,
"top_p": 0.95
},
"logs": "",
"output": [
"Let",
"'s",
" see",
"...",
" the",
" word",
" is",
" \"",
"str",
"aw",
"berry",
".\"",
" I",
" need",
" to",
" find",
" out",
" how",
" many",
" '",
"r",
"'s",
" are",
" in",
" it",
".",
" Okay",
",",
" let",
"'s",
" spell",
" it",
" out",
" slowly",
":",
" S",
"-T",
"-R",
"-A",
"-W",
"-B",
"-E",
"-R",
"-R",
"-Y",
".",
" I",
" can",
" see",
" that",
" there",
" are",
" two",
" '",
"r",
"'s",
" in",
" the",
" word",
".",
" Wait",
",",
" let",
" me",
" check",
" again",
" because",
" sometimes",
" letters",
" can",
" be",
" tricky",
".",
" S",
"-T",
"-R",
"-A",
"-W",
"-B",
"-E",
"-R",
"-R",
"-Y",
".",
" Yes",
",",
" there",
"'s",
" an",
" '",
"r",
"'",
" after",
" the",
" s",
",",
" then",
" another",
" one",
" between",
" e",
" and",
" y",
" at",
" the",
" end",
".",
" So",
" that",
"'s",
" two",
" '",
"r",
"'s",
".",
" I",
" think",
" that",
"'s",
" correct",
".",
" But",
" just",
" to",
" be",
" sure",
",",
" maybe",
" I",
" should",
" look",
" it",
" up",
" or",
" have",
" someone",
" else",
" check",
" it",
".",
" But",
" I",
"'m",
" pretty",
" confident",
" that",
" there",
" are",
" two",
" '",
"r",
"'s",
" in",
" \"",
"str",
"aw",
"berry",
".\"",
" Maybe",
" I",
" can",
" count",
" the",
" letters",
" one",
" by",
" one",
":",
" S",
" is",
" ",
"1",
",",
" T",
" is",
" ",
"2",
",",
" R",
" is",
" ",
"3",
",",
" A",
" is",
" ",
"4",
",",
" W",
" is",
" ",
"5",
",",
" B",
" is",
" ",
"6",
",",
" E",
" is",
" ",
"7",
",",
" R",
" is",
" ",
"8",
",",
" R",
" is",
" ",
"9",
",",
" Y",
" is",
" ",
"1",
"0",
".",
" Wait",
",",
" that",
" says",
" there",
" are",
" three",
" '",
"r",
"'s",
".",
" But",
" earlier",
" I",
" thought",
" there",
" were",
" only",
" two",
".",
" Hmm",
",",
" maybe",
" I",
" mis",
"count",
"ed",
".",
" Let",
" me",
" do",
" it",
" again",
":",
" S",
"-T",
"-R",
"-A",
"-W",
"-B",
"-E",
"-R",
"-R",
"-Y",
".",
" Okay",
",",
" first",
" '",
"r",
"'",
" is",
" the",
" third",
" letter",
",",
" then",
" another",
" one",
" before",
" the",
" last",
" letter",
",",
" and",
" another",
" one",
" before",
" that",
".",
" So",
" yes",
",",
" there",
" are",
" three",
" '",
"r",
"'s",
".",
" I",
" don",
"'t",
" know",
" why",
" I",
" thought",
" there",
" were",
" only",
" two",
" earlier",
".",
" Maybe",
" I",
" skipped",
" one",
".",
" So",
",",
" the",
" correct",
" answer",
" is",
" three",
" '",
"r",
"'s",
" in",
" \"",
"str",
"aw",
"berry",
".\"",
" I",
" should",
" remember",
" that",
" for",
" future",
" reference",
".",
""
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-17T03:53:40.756Z",
"started_at": "2024-12-17T03:53:40.76456Z",
"completed_at": "2024-12-17T03:53:52.231685Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/z1v04rr8jhrm80cktb0bhdg9zg/cancel",
"get": "https://api.replicate.com/v1/predictions/z1v04rr8jhrm80cktb0bhdg9zg",
"stream": "https://stream-b.svc.ric1.c.replicate.net/v1/streams/ag3tnhnx7c2uh2cstb2ancc3xw4gg7tljlapydheo73q6ql3cgnq",
"web": "https://replicate.com/p/z1v04rr8jhrm80cktb0bhdg9zg"
},
"metrics": {
"predict_time": 11.467124757,
"total_time": 11.475685
}
}