Skip to content

add extra_headers for ollama completion - #7180

Closed
kjohnsen wants to merge 1 commit into
BerriAI:mainfrom
kjohnsen:main
Closed

kjohnsen wants to merge 1 commit into
BerriAI:mainfrom
kjohnsen:main

Conversation

@kjohnsen

Copy link
Copy Markdown

Title

Add extra headers for ollama completion

Relevant issues

Fixes #7179

Type

🆕 New Feature

Changes

  • extra_headers passed in to ollama via optional_params
  • not yet implemented for ollama_chat

[REQUIRED] Testing - Attach a screenshot of any new tests passing locall

If UI changes, send a screenshot/GIF of working UI fixes

no new tests

@vercel

vercel Bot commented Dec 11, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 7:12pm

Comment thread litellm/main.py
## RESPONSE OBJECT
response = model_response
elif custom_llm_provider == "ollama":
if extra_headers is not None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe the headers field should already have this.

we just need extra_headers passed to an llm provider integration for openai/azure as they use the openai sdk which requires it in that way

the rest, can just use the headers field - which already updates if 'extra_headers' is passed as a param to the sdk

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was just following the pattern for other providers where extra_headers was included in optional_params. Are you proposing optional_params['headers'] = headers instead of optional_params['extra_headers'] = extra_headers?

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions Bot added the stale label Jul 22, 2025
@github-actions github-actions Bot closed this Jul 29, 2025

This branch was successfully deployed

1 active deployment
Preview — 2f5dd215 Deployed Dec 11, 2024 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support custom headers for ollama

2 participants