@@ -238,10 +238,11 @@ print(client.get_languages())
238238``` python
239239# pip install judge0 ollama
240240import os
241+
241242from ollama import Client
242243import judge0
243244
244- # Get your Ollama Cloud API key from https://ollama.com.
245+ # Get your free tier Ollama Cloud API key at https://ollama.com.
245246client = Client(
246247 host = " https://ollama.com" ,
247248 headers = {" Authorization" : " Bearer " + os.environ.get(" OLLAMA_API_KEY" )},
@@ -274,10 +275,11 @@ print(f"CODE EXECUTION RESULT:\n{result.stdout}")
274275``` python
275276# pip install judge0 ollama
276277import os
278+
277279from ollama import Client
278280import judge0
279281
280- # Get your Ollama Cloud API key from https://ollama.com.
282+ # Get your free tier Ollama Cloud API key at https://ollama.com.
281283client = Client(
282284 host = " https://ollama.com" ,
283285 headers = {" Authorization" : " Bearer " + os.environ.get(" OLLAMA_API_KEY" )},
@@ -335,6 +337,7 @@ print(f'FINAL RESPONSE BY THE MODEL:\n{final_response["message"]["content"]}')
335337
336338``` python
337339# pip install judge0 ag2[openai]
340+ import os
338341from typing import Annotated, Optional
339342
340343from autogen import ConversableAgent, LLMConfig, register_function
@@ -367,12 +370,13 @@ class PythonCodeExecutionTool(Tool):
367370
368371python_executor = PythonCodeExecutionTool()
369372
373+ # Get your free tier Ollama Cloud API key at https://ollama.com.
370374llm_config = LLMConfig(
371375 {
372376 " api_type" : " openai" ,
373- " base_url" : " http ://localhost:11434 /v1" ,
374- " api_key" : " ollama " ,
375- " model" : " qwen3-coder:30b " ,
377+ " base_url" : " https ://ollama.com /v1" ,
378+ " api_key" : os.environ.get( " OLLAMA_API_KEY " ) ,
379+ " model" : " qwen3-coder:480b-cloud " ,
376380 }
377381)
378382
0 commit comments