diff --git a/README.md b/README.md index b3d9c00..e8b4e40 100644 --- a/README.md +++ b/README.md @@ -178,9 +178,7 @@ you need to pull the model you want to ollama before using it curl http://localhost:11434/api/pull -d '{ "name": "deepseek-coder-v2" }' -your assistants client should route to the ollama container by passing the llm-param-base-url header: - - client = patch(OpenAI(default_headers={"LLM-PARAM-base-url": "http://ollama:11434"})) +your assistants client should route to the ollama container setting OLLAMA_API_BASE_URL. OLLAMA_API_BASE_URL should be set to http://ollama:11434 if you are using docker-compose. If you are using ollama on your localhost you can set it to http://localhost:11434 ## Feedback / Help diff --git a/examples/python/agency-swarm/local_open_source_models.py b/examples/python/agency-swarm/local_open_source_models.py index 46e2898..bed5b45 100644 --- a/examples/python/agency-swarm/local_open_source_models.py +++ b/examples/python/agency-swarm/local_open_source_models.py @@ -6,9 +6,8 @@ load_dotenv("./.env") load_dotenv("../../../.env") -client = patch(OpenAI(default_headers={"LLM-PARAM-base-url": "http://localhost:11434"})) -# if using docker-compose, pass custom header to point to the ollama container instead of localhost -# client = patch(OpenAI(default_headers={"LLM-PARAM-base-url": "http://ollama:11434"})) +# remember to set OLLAMA_API_BASE_URL="http://ollama:11434" and base_url="http://localhost:8000/v1" in your env +client = patch(OpenAI()) set_openai_client(client) @@ -25,4 +24,4 @@ print(assistant) completion = agency.get_completion("What's something interesting about language models?") -print(completion) \ No newline at end of file +print(completion)