Created
September 4, 2025 07:20
-
-
Save ncouture/a97fce3ff82471d62a72fd81d6d8664a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from openai import OpenAI | |
| client = OpenAI( | |
| base_url="http://localhost:11434/v1", # Local Ollama API | |
| api_key="ollama" # Dummy key | |
| ) | |
| response = client.chat.completions.create( | |
| model="gpt-oss:20b", | |
| messages=[ | |
| {"role": "system", "content": "You are a helpful assistant."}, | |
| {"role": "user", "content": "Explain what a black hole is?"} | |
| ] | |
| ) | |
| print(response.choices[0].message.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment