Ollama中deepseek排名的第一,下载次数是17M,第二名的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();
var streamContent = chatCompletionService.GetStreamingChatMessageContentsAsync(“出几道勾股定理的题”);
await foreach (var content in streamContent)
{
Console.Write(content.Content);
}
下面是测试结果,不论他结果正确与否,这速是挺快,在本地跑效果还是挺好的(视频原速播放):
,时长00:37
依然没有支持function calling,在一定程度上对开发不够友好。从结果可以看出,deepseek-r1用了很大篇幅在推理,过后才给出结果。
声明:文中观点不代表本站立场。本文传送门:https://eyangzhen.com/425173.html