DeepSeek in Python

Working with DeepSeek in Python

James Chapman

Curriculum Manager, DataCamp

Coming up...

 

Course goals
  • Access DeepSeek models
  • Solve real-world tasks
  • Build your own chatbot! 🤖
  • Use Python code to do this!

 

Expected knowledge
  • Subsetting Python lists and dictionaries
  • Control flow → if, elif, else
  • Loops → for, while

 

Not expected to know
  • AI or machine learning
Working with DeepSeek in Python

The DeepSeek logo.

  • AI company based in China
  • Trained V3 and R1 ~30x cheaper than market-leaders
Working with DeepSeek in Python

DeepSeek model types

A chat icon.

Chat → V3

  • Generates conversations
  • Use: chatbots

A reasoning icon.

Reasoning → R1

  • Deeper reasoning
  • Use: data analysis, research, coding assistance
Working with DeepSeek in Python

Accessing DeepSeek models

The DeepSeek logo.

Working with DeepSeek in Python

Accessing DeepSeek models

The DeepSeek API crossed out.

Working with DeepSeek in Python

Accessing DeepSeek models

The Together.ai API with some of the models it supports.

Working with DeepSeek in Python

What is an API?

  • Application Programming Interface

A computer sending a request to an API.

Working with DeepSeek in Python

What is an API?

  • Application Programming Interface

A waiter delivering orders and food between the kitchen and tables. This mimics how APIs operate between devices and systems.

Working with DeepSeek in Python

What is an API?

Our device location is being sent to an API, which is then passed to a database. The API returns the response from the system, the weather forecast, back to our device.

Working with DeepSeek in Python

DeepSeek models via APIs

A computer sending a request to the Together.ai API.

Working with DeepSeek in Python

DeepSeek models via APIs

A computer sending a request to the Together.ai API, which contains the model and any data and model parameters.

Working with DeepSeek in Python

Why use DeepSeek via an API?

 

Chatbot

  • Augmenting personal workflows and tasks

 

API

  • Provides flexibility for integrating AI into products, experiences, and processes
  • Interact via programming language

A computer interacting with the Together.ai API.

Working with DeepSeek in Python

Let's practice!

Working with DeepSeek in Python

Preparing Video For Download...