0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

# Semantic Kernel:ローカル deepseek-r1:1.5b の接続

Posted at

Ollamaにおいて、deepseekはランキングで1位に位置し、ダウンロード数は17Mを記録しています。2位のllama 3.3のダウンロード数は1.3Mであり、その人気の高さが伺えます。

Ollamaの具体的なアドレスは以下の通りです:https://ollama.com/search

画像

私たちはSKを用いてOllamaと組み合わせ、ローカルモデルをテストしました。まずOllamaをインストールし、deepseek-r1:1.5bをローカルに取得します。以下にSKのOllamaを用いて1.5bをロードする方法を示します。

using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.Ollama;
using OpenAI.Chat;
using System.ComponentModel;

#pragma warning disable
var modelId = "deepseek-r1:1.5b";
var endpoint = new Uri("http://localhost:11434");
var builder = Kernel.CreateBuilder();
builder.Services.AddOllamaChatCompletion(modelId, endpoint);
var kernel = builder.Build();
var chatCompletionService = kernel.GetRequiredService<IChatCompletionService>();
var streamContent = chatCompletionService.GetStreamingChatMessageContentsAsync("出几道勾股定理的题");
await foreach (var content in streamContent)
{
    Console.Write(content.Content);
}

以下はテスト結果です。結果が正確か否かにかかわらず、その速度は非常に速く、ローカルでの実行において良好な効果を示しています(動画のオリジナル速度再生)。

動画画像

依然としてfunction callingをサポートしていないため、開発に対しては若干不親切です。結果からは、deepseek-r1が大部分において推理に時間を費やし、の後に結果を提供していることがわかります。

(Translated by GPT)
元のリンク:https://mp.weixin.qq.com/s/KdhXed2_bqKituUKjSySoQ?token=1135395277&lang=zh_CN&wt.mc_id=MVP_325642

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?