KEMBAR78
Standard Operating Procedure (SOP) For Using LLMs ( | PDF
0% found this document useful (0 votes)
5 views12 pages

Standard Operating Procedure (SOP) For Using LLMs (

Uploaded by

naithikgupta123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

Standard Operating Procedure (SOP) For Using LLMs (

Uploaded by

naithikgupta123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Standard Operating

Procedure (SOP) for Using


LLMs
Ensuring Responsible, Efficient, and Secure Use of Large Language Models in
Daily Workflows
Tools 1 Google Gemini

Covered in 2 OpenAi(Chat-GPT)

this SOP 3 Grok Ai


Gemini - Accessing the API

1 Visit - https://aistudio.google.com/
2 Click Get API-key
3 Click Create API-key
4 Select Google Cloud Project
5 Click Create API
OpenAi(Chat-GPT)- Accessing the API

1 Visit - https://platform.openai.com/chat
2 Click Get API-key
3 Click Create API-key
4 Select Google Cloud Project
5 Click Create API
Grok- Accessing the API

1 Visit - https://docs.x.ai/docs/models
2 Click on your profile
3 Click Go to Console
4 Click API keys
5 Click Create API key
6 Fill requirements & Click create API
Using Google Gemini API in Python
Install the SDK
pip install google-generativeai

Sample Initialization code


import google.generativeai as genai

# Configure API key


genai.configure(api_key="YOUR_GEMINI_API_KEY")

# Choose a model (e.g. gemini-pro for text)


model = genai.GenerativeModel("gemini-pro")

# Generate content
response = model.generate_content("Write a haiku about data science.")
print(response.text)
Using OpenAi API in Python
Install the SDK
pip install openai

Sample Initialization code


from openai import OpenAI

# Initialize client
client = OpenAI(api_key="YOUR_OPENAI_API_KEY")

# Generate response
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "You are an assistant."},
{"role": "user", "content": "Explain quantum computing in
simple terms."}
]
)

print(response.choices[0].message["content"])
Using Grok in Python
Install the SDK
pip install openai

Sample Initialization code


client=OpenAI(api_key=os.getenv("XAI_API_KEY"),base_url="https://api.x.ai/v1")

response = client.chat.completions.create(
model="grok-3",
messages=[
{"role": "system", "content": "You are Grok, a helpful assistant."},
{"role": "user", "content": "Explain how vaccines work in simple terms."}
],
max_tokens=200,
temperature=0.7
)

print(response.choices[0].message["content"])

You might also like