Deepseek on Vertex AI endpoints

The Sting Development
9 min readJan 29, 2025

--

A Wednesday afternoon knowledge sharing session at the Sting gaining knowledge about the rumorous Deepseek model

Lots of rumors the last days on Deepseek. An LLM model that made quite an entrance, dropping the NVIDIA stocks with 620 billion. So we got intrigued and interested in getting our hands dirty.

Vertex AI Endpoints

So our initial thought was to download the Deepseek model from Huggingface and prepare this for deployment on Vertex AI endpoints. But Google was already a step ahead!

The Deepseek model was already available in the Vertex AI model garden.

As we also have to take into account the costs, we decided not to take the Deepseek deepseek-r1:671b model (404GB) but the deepseek-r1:70b model (as that was already available).

The machine available for us was the a3-highgpu-4g a $64 per hour machine.

So from model garden there is this “Deploy options”

Ok , easy, lets set things up.

It will take a while to deploy the model to the endpoint as the machine needs to be provisioned first.

If you go to Online predictions in the left-hand menu in the Google Cloud Console, you can see if it is deployed.

This will bring you to the available endpoints in a certain gcp region.

Making requests to the endpoint

Now we want to actually create a request to the Vertex AI endpoint.
Although the mentioned example is already quite ok, here is the actual request we used.

The curl command to make the prediction call is as followed:

curl --location 'https://europe-west4-aiplatform.googleapis.com/v1/projects/1010101010101/locations/europe-west4/endpoints/000000000000001:predict' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"instances": [
{
"prompt": "How does Deepseek R1 compare to ChatGPT 3.5?",
"max_tokens": 2048,
"temperature": 0.6,
"top_p": 1.0,
"top_k": -1
}
]
}'

The Vertex AI endpoint response

{
"predictions": [
"Prompt:\nHow does Deepseek R1 compare to ChatGPT 3.5?\n
Output:\n Let's break it down.\n\nDeepseek R1 and ChatGPT 3.5 are both
AI models developed by different companies, primarily designed for
generating human-like text based on the input they receive.
Here’s a comparison based on some key factors:\n\n1.
**Model Architecture**: \n -
**Deepseek R1**: It is based on a proprietary architecture developed
by DeepSeek, which might be similar to other transformer-based models but could have unique optimizations or modifications.\n - **ChatGPT 3.5**: Developed by OpenAI, it uses the GPT (Generative Pre-trained Transformer) architecture, which is well-established and widely used in the industry.\n\n2. **Training Data**:\n - **Deepseek R1**: Trained on a diverse dataset, possibly including a wide range of texts from books, articles, research papers, and websites, but specific details might not be publicly disclosed.\n - **ChatGPT 3.5**: Trained on a massive dataset that includes a broad spectrum of texts from the internet, books, and other sources up until 2023. The exact composition is not entirely transparent but is known to be extensive.\n\n3. **Performance**:\n - **Deepseek R1**: May excel in specific tasks or domains where its training data and fine-tuning focus. Performance can vary based on the use case.\n - **ChatGPT 3.5**: Generally known for strong performance across a wide range of tasks, including conversational dialogue, text generation, and problem-solving. It's optimized for engaging and coherent responses.\n\n4. **Availability and Accessibility**:\n - **Deepseek R1**: May have different accessibility options. It could be integrated into specific applications or platforms, but it might not be as widely available as ChatGPT.\n - **ChatGPT 3.5**: Widely available through OpenAI's API and various third-party applications. It's accessible to a broad audience, including developers and end-users.\n\n5. **Customization and Fine-tuning**:\n - **Deepseek R1**: Depending on how it's deployed, there might be options for customization. However, this could be more limited compared to OpenAI's offerings.\n - **ChatGPT 3.5**: Offers more flexibility for fine-tuning and customization, especially through OpenAI's API, allowing developers to adapt the model to specific use cases.\n\n6. **Cost**:\n - **Deepseek R1**: Pricing would depend on how DeepSeek offers the model. It could be competitive, but without specific information, it's hard to compare directly.\n - **ChatGPT 3.5**: Pricing is transparent through OpenAI's API tiers, offering both free and paid options depending on usage and requirements.\n\n7. **Community and Support**:\n - **Deepseek R1**: The community and support might be growing but could be smaller compared to OpenAI's established ecosystem.\n - **ChatGPT 3.5**: Benefits from a large and active community, extensive documentation, and robust support from OpenAI.\n\nIn summary, while both models are capable in their own right, ChatGPT 3.5 has the advantage of being a more established and widely used model with extensive community support and customization options. Deepseek R1, on the other hand, may offer unique features or optimizations that could make it preferable for specific applications or regions. The choice between them would depend on your particular needs, such as the type of tasks, accessibility requirements, and any regional or language-specific considerations."
],
"deployedModelId": "7925660244032618496",
"model": "projects/1010101010101/locations/europe-west4/models/deepseek",
"modelDisplayName": "deepseek",
"modelVersionId": "1"
}

Ok, that seemed to work. Although it was not the slowest machine available and in my opinion quite expensive the response time was 26.55s (We didn’t benchmark against other models).

As we are developers making api calls like this is no fun.
So we started a small NextJS application to give it a more visual touch:

Deepseek gave a quite elaborative answer on the question “What is special about the number 42?”

It’s the answer to life, the universe, and everything, according to Douglas Adams’ science fiction series, The Hitchhiker’s Guide to the Galaxy. But does it have any special significance in mathematics? Well, 42 is a pronic number, which is a number that is the product of two consecutive integers. Specifically, 42 = 6 × 7. It’s also a primary pseudoperfect number, which means that it’s equal to the sum of its proper divisors (excluding itself). The proper divisors of 42 are 1, 2, 3, 6, 7, 14, and 21, and their sum is 1+2+3+6+7+14+21=54, which is more than 42, so actually, maybe I’m wrong about that.

Wait, no, a primary pseudoperfect number is a number that is equal to the sum of its proper divisors in a particular way—it has to be the sum of some subset of its divisors. Oh, right, but 42 is actually an abundant number, because the sum of its proper divisors is greater than the number itself. So, scratch that.

Is 42 a perfect number? No, perfect numbers are numbers where the sum of their proper divisors equals the number itself. The smallest perfect numbers are 6, 28, 496, etc. So 42 is not a perfect number. Is it a triangular number? Let me check. The formula for triangular numbers is n(n+1)/2. Solving 42 = n(n+1)/2 gives n^2 + n - 84 = 0. The discriminant is 1 + 336 = 337. The square root of 337 is approximately 18.357, so n would be (-1 + 18.357)/2 ≈ 8.678. Not an integer, so 42 is not a triangular number.

How about a square number? 6^2 is 36, 7^2 is 49, so 42 is not a square. Is it a cube? 3^3 is 27, 4^3 is 64, so no. Maybe a factorial? 5! is 120, which is too big, 4! is 24, so no. So 42 isn't a factorial either.

In terms of prime factors, 42 factors into 2 × 3 × 7. So it's a product of three distinct primes. That's interesting. It's also the sixth pronic number because 6 × 7 is 42, and pronic numbers are numbers of the form n(n+1), so n=6 gives 42. So 42 is a pronic number.

Is 42 a Harshad number? A Harshad number is a number that is divisible by the sum of its digits. The sum of the digits of 42 is 4 + 2 = 6, and 42 ÷ 6 = 7, which is an integer. So yes, 42 is a Harshad number.

Is 42 a perfect square? No, as we saw earlier. Is it a perfect cube? Also no. Is it a Fibonacci number? Let's see: the Fibonacci sequence goes 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, etc. 42 isn't in that sequence.

In terms of binary, 42 is 101010, which is a nice alternating pattern of bits. In hexadecimal, 42 is 2A. Not particularly special. In Roman numerals, 42 is XLII, which is also not especially notable.

In terms of time, 42 is the number of minutes in a jellyfish's lifespan in the movie Finding Nemo, but that's probably not mathematically significant. However, 42 is also the number of the French department Loire. But again, not math-related.

In astronomy, 42 is the Messier number for the Orion Nebula, M42. That's a famous deep-sky object, so that might be considered a special significance.

In the context of the Hitchhiker's Guide, 42 is the answer to the ultimate question, but the actual question is unknown. So, in popular culture, 42 has become a kind of meme for the answer to life, the universe, and everything.

So, putting it all together, mathematically, 42 is a pronic number, a Harshad number, and has the prime factors 2, 3, and 7. It's also an abundant number. Beyond mathematics, it's most famous for its role in The Hitchhiker’s Guide to the Galaxy.

**Final Answer**
The number 42 is special because it is the product of two consecutive integers, making it a pronic number, and in popular culture, it is known as the "Answer to the Ultimate Question of Life, the Universe, and Everything." Therefore, the final answer is \boxed{42}.
</think>

The number 42 is special for several mathematical reasons and its cultural significance. Mathematically, 42 is a pronic number, which means it is the product of two consecutive integers (6 × 7). It is also a Harshad number, as it is divisible by the sum of its digits (4 + 2 = 6, and 42 ÷ 6 = 7). Additionally, 42 is an abundant number because the sum of its proper divisors (1, 2, 3, 6, 7, 14, 21) is 54, which is greater than 42.

In popular culture, 42 is famously known as the "Answer to the Ultimate Question of Life, the Universe, and Everything" from Douglas Adams' science fiction series, The Hitchhiker’s Guide to the Galaxy.

### Final Answer
The number 42 is special because it is the product of two consecutive integers, making it a pronic number, and in popular culture, it is known as the "Answer to the Ultimate Question of Life, the Universe, and Everything." Therefore, the final answer is \boxed{42}.

So, Deepseek worked and it was easy to deploy on GCP, although it can be quite costly. Although we only touched the tip of the iceberg, the potential is good especially when you take into account how much it did cost to build the model. It is nice to see the established order gets shaken a little bit and hopefully we will benefit from this eventually.

Thanks for reading!

This writing was created by Martijn Schouwe , Tech Lead at the Sting and Phi Son Do Senior Frontend Developer.

--

--

The Sting Development
The Sting Development

Written by The Sting Development

The Sting development is part of the Sting retail building tech for the Sting, Costes fashion and Cotton Club. Playing on the boundary where fashion meets tech!

Responses (2)