ollama
This commit is contained in:
16
w14_olama/basics.js
Normal file
16
w14_olama/basics.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import delay from 'delay';
|
||||
|
||||
fetch('http://localhost:11434/api/generate', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
model: 'qwen2.5-coder:1.5b', // replace with your model name
|
||||
prompt: 'Tell me a joke!',
|
||||
stream: false,
|
||||
think: false,
|
||||
}),
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((data) => data.response)
|
||||
.then(console.log)
|
||||
.catch(console.error);
|
||||
Reference in New Issue
Block a user