Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Linux Tipps & HardeningSecurity: Ausführen beliebiger Kommandos in perl-Dancer2 (Fedora)(29.09.2026 um 07:43 Uhr)
•
Linux Tipps & HardeningSecurity: Denial of Service in perl-HTML-FormFu (Fedora)(29.09.2026 um 07:46 Uhr)
••
Linux Tipps & HardeningSecurity: Zwei Probleme in NetworkManager-l2tp (Fedora)(29.09.2026 um 07:46 Uhr)
••
Sicherheitslücken (CVE)CVE-2026-77144 | TYPO3 Events 2 Plugin up to 10.2.11 permission(29.09.2026 um 06:21 Uhr)
•
Sicherheitslücken (CVE)CVE-2026-21753 | HCL Hive 1.0 unmaintained third party components(29.09.2026 um 06:21 Uhr)
••
Sicherheitslücken (CVE)CVE-2026-75038 | ilya-zlobintsev LACT up to 0.10.0 symlink(29.09.2026 um 06:21 Uhr)
••
Linux Tipps & HardeningSecurity: Ausführen beliebiger Kommandos in perl-Dancer2 (Fedora)(29.09.2026 um 07:43 Uhr)
•
Linux Tipps & HardeningSecurity: Denial of Service in perl-HTML-FormFu (Fedora)(29.09.2026 um 07:46 Uhr)
••
Linux Tipps & HardeningSecurity: Zwei Probleme in NetworkManager-l2tp (Fedora)(29.09.2026 um 07:46 Uhr)
••
Sicherheitslücken (CVE)CVE-2026-77144 | TYPO3 Events 2 Plugin up to 10.2.11 permission(29.09.2026 um 06:21 Uhr)
•
Sicherheitslücken (CVE)CVE-2026-21753 | HCL Hive 1.0 unmaintained third party components(29.09.2026 um 06:21 Uhr)
••
Sicherheitslücken (CVE)CVE-2026-75038 | ilya-zlobintsev LACT up to 0.10.0 symlink(29.09.2026 um 06:21 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Quick tip: Using Ollama and DeepSeek-R1 with OpenAI Chat

Abstract DeepSeek-R1 can run locally using Ollama, which is also compatible with OpenAI. This allows us to configure Ollama to use DeepSeek-R1 as a seamless replacement for an OpenAI model. In this article, we'll build a simple chatbot…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Abstract



DeepSeek-R1 can run locally using Ollama, which is also compatible with OpenAI. This allows us to configure Ollama to use DeepSeek-R1 as a seamless replacement for an OpenAI model. In this article, we'll build a simple chatbot using Ollama and DeepSeek-R1.



The notebook file used in this article is available on GitHub.






Introduction



In a previous article, we tested a DeepSeek-R1 using Ollama for four different test cases. We'll now build a simple chatbot to test DeepSeek-R1 using OpenAI chat completions.



We'll use the smallest DeepSeek-R1 model, as it does not require any GPUs.



With Jupyter and Ollama running locally, we'll load the notebook downloaded from GitHub.






Run the code



After installing and importing the appropriate libraries, we'll download the smallest DeepSeek-R1 model, as follows:




model = "deepseek-r1:1.5b"

ollama.pull(model)






Next, we'll configure Ollama for OpenAI compatibility:




ollama_client = OpenAI(
base_url = "http://localhost:11434/v1",
api_key = "ollama"
)






Finally, we'll ask a question using chat completions:




response = ollama_client.chat.completions.create(
model = model,
messages = [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "What is the answer to life, the universe and everything?"}
]
)

content = response.choices[0].message.content
remove_think_tags = True

if remove_think_tags:
content = re.sub(r"<think>.*?</think>", "", content, flags = re.DOTALL)

print(content)






We'll disable <think> and </think> using a flag so that we can control the output of its reasoning process.



Example output:




Without knowing what a final theory would look like, we might not be able to distinguish life from non-living matter. Similarly, for the universe itself, without knowing about the ultimate reality, we can't tell. Therefore, both concepts remain indefinitely speculative and undetermined in their completeness.

**Final Answer:**
In our current understanding, neither the universe nor life is fully established with an accepted answer due to the inherent uncertainties in defining ultimate principles and truth.









Summary



We can easily use DeepSeek-R1 with Ollama for chat completions. Since Ollama provides OpenAI compatibility, it is easy to use DeepSeek-R1 as a drop-in replacement for an OpenAI model.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Quick tip: Using Ollama and DeepSeek-R1 with OpenAI Chat

Thematisch verwandte Begriffe: Quick, Using, Ollama, DeepSeekR1 · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-102367 | mall4j through 4.0 contains an insufficient session expiration vulnerab…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag