Skip to content

Commit

Permalink
fix: add info on running with remote ollama (#83)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Dawson <[email protected]>
  • Loading branch information
mhdawson authored Oct 15, 2024
1 parent 58d072f commit ed6405d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/llms/providers/ollama.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { OllamaLLM } from "bee-agent-framework/adapters/ollama/llm";
import { OllamaChatLLM } from "bee-agent-framework/adapters/ollama/chat";
import { BaseMessage } from "bee-agent-framework/llms/primitives/message";
import { Ollama } from "ollama";

{
console.info("===RAW===");
Expand Down Expand Up @@ -40,3 +41,24 @@ import { BaseMessage } from "bee-agent-framework/llms/primitives/message";
]);
console.info(response.finalResult);
}

{
console.info("===REMOTE OLLAMA===");
const llm = new OllamaChatLLM({
modelId: "llama3.1",
client: new Ollama({
// use the IP for the server you have ollama running on
host: "http://10.1.2.38:11434",
}),
});

console.info("Meta", await llm.meta());

const response = await llm.generate([
BaseMessage.of({
role: "user",
text: "Hello world!",
}),
]);
console.info(response.finalResult);
}

0 comments on commit ed6405d

Please sign in to comment.