ScaDS.AI LLM endpoint#
In this notebook we will access large language mocels hosted at the ScaDS.AI LLM infrastructure infrastructure of the Center for Information Services and High Performance Computing (ZIH) of TU Dresden. To use it, you must be connected via TU Dresden VPN. This method uses the openai Python library, and the OpenAI API. We just change the base_url
.
Read more#
import os
import openai
openai.__version__
'1.64.0'
def prompt_scadsai_llm(message:str, model="meta-llama/Llama-3.3-70B-Instruct"):
"""A prompt helper function that sends a message to ScaDS.AI LLM server at
ZIH TU Dresden and returns only the text response.
"""
import os
import openai
# convert message in the right format if necessary
if isinstance(message, str):
message = [{"role": "user", "content": message}]
# setup connection to the LLM
client = openai.OpenAI(base_url="https://llm.scads.ai/v1",
api_key=os.environ.get('SCADSAI_API_KEY')
)
response = client.chat.completions.create(
model=model,
messages=message
)
# extract answer
return response.choices[0].message.content
print(prompt_scadsai_llm("Hi!"))
It's nice to meet you. Is there something I can help you with or would you like to chat?
We can also use reasoning models such as the DeepSeek-R1 model hosted on the server.
print(prompt_scadsai_llm("What is the meaning of life?", model="deepseek-ai/DeepSeek-R1"))
Okay, the user is asking about the meaning of life. That's a big question. I need to approach this carefully. Where do I start?
First, I remember that different fields have different takes. Philosophy, religion, science, and personal beliefs each have their own perspectives. Maybe I should outline each one.
Philosophy: Existentialists like Sartre and Camus say we create our own meaning. Absurdism, as per Camus, accepts the search for meaning in a meaningless world. Nietzsche talks about the will to power and creating your own values. Then there's religious views. Christianity and Islam often point to serving a divine purpose. Eastern religions like Buddhism and Hinduism might focus on enlightenment and escaping suffering through cycles of rebirth.
Science: Evolutionary perspective might say reproduction and survival. But that's more of a 'how' than a 'why.' Neuroscientists might link meaning to brain functions related to happiness and social bonds.
Personal meaning: Many people find purpose in relationships, creativity, helping others, personal goals. Maybe mention Viktor Frankl's "Man's Search for Meaning," where he says meaning comes from what we give to the world, our relationships, our attitudes.
Should I mention that there's no single answer? Yes, it's important to note that it's subjective. Also, the user might be looking for reassurance or different viewpoints rather than a definitive answer.
Wait, do I need to address any potential follow-up questions? Like, why do people ask this? Or how to find personal meaning? Maybe touch on that briefly but stay concise.
Check for any cultural considerations. The answer shouldn't favor any religion or belief system. Keep it neutral and inclusive.
Finally, wrap it up by emphasizing the personal journey aspect. Encourage reflection on values, passions, and impact. That should cover it without being too prescriptive.
</think>
The question of the meaning of life is deeply subjective and has been explored through various lenses, including philosophy, religion, science, and personal experience. Here’s a concise overview of different perspectives:
1. **Philosophical Perspectives**:
- **Existentialism**: Proposes that individuals create their own meaning through choices and actions (e.g., Sartre, Camus). Camus' "absurdism" argues that embracing life’s lack of inherent meaning is key to living authentically.
- **Nihilism**: Suggests life has no intrinsic meaning, but this can be liberating rather than despairing.
- **Stoicism**: Advocates finding purpose in virtue, acceptance, and living in harmony with nature.
2. **Religious/Spiritual Views**:
- **Theistic Religions** (e.g., Christianity, Islam, Hinduism): Often tie life’s purpose to divine connection, moral growth, or transcending suffering (e.g., moksha, nirvana, union with God).
- **Buddhism**: Emphasizes ending suffering (dukkha) through enlightenment and compassion.
3. **Scientific Angles**:
- **Biology/Evolution**: Life’s "purpose" may relate to survival, reproduction, and adaptation. However, science typically explains "how" rather than "why."
- **Cosmic Perspective**: Some find awe in the universe’s vastness and our fleeting but conscious role within it.
4. **Personal Meaning**:
- Many derive meaning from relationships, creativity, helping others, pursuit of knowledge, or personal goals. Viktor Frankl, in *Man’s Search for Meaning*, argues meaning arises from our responses to life’s challenges, our contributions, and our attitudes.
**In Short**: There’s no universally agreed-upon answer. The search itself may be part of the journey—a chance to reflect on values, passions, and the legacy one wishes to leave. What gives *your* life meaning?
Exercise#
List the models available in the endpoint and try them out by specifying them when calling prompt_scadsai_llm("...", model=...)
.
client = openai.OpenAI(base_url="https://llm.scads.ai/v1",
api_key=os.environ.get('SCADSAI_API_KEY'))
print("\n".join([model.id for model in client.models.list().data]))
mistral-7b-q4
deepseek-ai/DeepSeek-R1
CohereForAI/c4ai-command-r-08-2024
tts-1-hd
deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
openGPT-X/Teuken-7B-instruct-research-v0.4
en-de-translator
Alibaba-NLP/gte-Qwen2-1.5B-instruct
deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct
meta-llama/Llama-3.3-70B-Instruct
Qwen/Qwen2-VL-7B-Instruct