Obiguard provides a robust and secure gateway to facilitate the integration of various Large Language Models (LLMs) into your applications, including DeepSeek models.
With Obiguard, you can take advantage of features like fast AI gateway access, observability, prompt management, and more, all while ensuring the secure management of your LLM API keys through a virtual key system.
To use DeepSeek with Obiguard, get your API key from here, then add it to Obiguard to create the virtual key.
Copy
from obiguard import Obiguardclient = Obiguard( obiguard_api_key="sk-obg***", # Your Obiguard API key virtual_key="VIRTUAL_KEY" # Replace with your virtual key for DeepSeek)
Copy
from obiguard import Obiguardclient = Obiguard( obiguard_api_key="sk-obg***", # Your Obiguard API key virtual_key="VIRTUAL_KEY" # Replace with your virtual key for DeepSeek)
import jsonfrom obiguard import Obiguardclient = Obiguard( obiguard_api_key="sk-obg***", # Your Obiguard API key virtual_key="VIRTUAL_KEY" # Replace with your virtual key for DeepSeek)system_prompt = """The user will provide some exam text. Please parse the "question" and "answer" and output them in JSON format.EXAMPLE INPUT:Which is the highest mountain in the world? Mount Everest.EXAMPLE JSON OUTPUT:{ "question": "Which is the highest mountain in the world?", "answer": "Mount Everest"}"""user_prompt = "Which is the longest river in the world? The Nile River."messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}]response = client.chat.completions.create( model="deepseek-chat", messages=messages, response_format={ 'type': 'json_object' })print(json.loads(response.choices[0].message.content))
Copy
import jsonfrom obiguard import Obiguardclient = Obiguard( obiguard_api_key="sk-obg***", # Your Obiguard API key virtual_key="VIRTUAL_KEY" # Replace with your virtual key for DeepSeek)system_prompt = """The user will provide some exam text. Please parse the "question" and "answer" and output them in JSON format.EXAMPLE INPUT:Which is the highest mountain in the world? Mount Everest.EXAMPLE JSON OUTPUT:{ "question": "Which is the highest mountain in the world?", "answer": "Mount Everest"}"""user_prompt = "Which is the longest river in the world? The Nile River."messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}]response = client.chat.completions.create( model="deepseek-chat", messages=messages, response_format={ 'type': 'json_object' })print(json.loads(response.choices[0].message.content))