Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Hugging Face as a provider#1911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kludex merged 35 commits intopydantic:mainfromhanouticelina:hf-inference-providers
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
35 commits
Select commitHold shift + click to select a range
2c3b9cb
add hf inference providers support
hanouticelinaJun 4, 2025
537a657
update dependencies
hanouticelinaJun 4, 2025
af602a5
nit
hanouticelinaJun 4, 2025
1f3f7a2
update docstring
hanouticelinaJun 4, 2025
bea050c
add tests
hanouticelinaJun 9, 2025
40aef2e
add docs and known models for hf
hanouticelinaJun 9, 2025
af6fa42
Merge branch 'main' of github.com:hanouticelina/pydantic-ai into hf-i…
hanouticelinaJun 9, 2025
7a4b9a4
fix imports in test
hanouticelinaJun 9, 2025
a153081
fix tests
hanouticelinaJun 9, 2025
2f0ec51
fix provider test
hanouticelinaJun 9, 2025
69aee55
adapt cli test
hanouticelinaJun 9, 2025
f68dace
re-record vcr cassettes
hanouticelinaJun 9, 2025
cc982e5
fix token name
hanouticelinaJun 9, 2025
00da46e
fix examples test
hanouticelinaJun 9, 2025
bb20a34
Merge remote-tracking branch 'origin/main' into hf-inference-providers
KludexJun 25, 2025
922fd13
Add API docs and refactor a bit the wording
KludexJun 25, 2025
c779503
Merge branch 'main' of github.com:hanouticelina/pydantic-ai into hf-i…
hanouticelinaJul 2, 2025
873f090
Merge branch 'hf-inference-providers' of github.com:hanouticelina/pyd…
hanouticelinaJul 2, 2025
adfc254
review suggestions
hanouticelinaJul 2, 2025
e4af59e
more tests
hanouticelinaJul 7, 2025
fbead3d
Merge branch 'main' of github.com:hanouticelina/pydantic-ai into hf-i…
hanouticelinaJul 7, 2025
cd76d78
fix test
hanouticelinaJul 7, 2025
13ebbf9
fix another test
hanouticelinaJul 7, 2025
b96b710
add more vcr tests
hanouticelinaJul 9, 2025
9b0edee
split thinking part
hanouticelinaJul 9, 2025
6da1cf2
fix tests
hanouticelinaJul 9, 2025
d546e04
add more context to hugging face models page
burtenshawJul 9, 2025
789c261
Update docs/models/huggingface.md
hanouticelinaJul 9, 2025
17b74d2
Merge pull request #1 from burtenshaw/docs/inference-providers-docs
hanouticelinaJul 9, 2025
96a9c96
add more tests
hanouticelinaJul 9, 2025
0c37e41
Merge branch 'hf-inference-providers' of github.com:hanouticelina/pyd…
hanouticelinaJul 9, 2025
60e5c74
coverage
hanouticelinaJul 9, 2025
f2a74dd
remove no-cover
hanouticelinaJul 9, 2025
eb4af3f
Merge remote-tracking branch 'origin/main' into hf-inference-providers
KludexJul 16, 2025
9539909
replace exception handling
KludexJul 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Merge branch 'main' of github.com:hanouticelina/pydantic-ai into hf-i…
…nference-providers
  • Loading branch information
@hanouticelina
hanouticelina committedJun 9, 2025
commitaf6fa42f0b0b2714b36a5ff4c9f547b32605dbf7
5 changes: 5 additions & 0 deletionspydantic_ai_slim/pydantic_ai/models/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -211,6 +211,11 @@
'groq:llama-3.2-3b-preview',
'groq:llama-3.2-11b-vision-preview',
'groq:llama-3.2-90b-vision-preview',
'heroku:claude-3-5-haiku',
'heroku:claude-3-5-sonnet-latest',
'heroku:claude-3-7-sonnet',
'heroku:claude-4-sonnet',
'heroku:claude-3-haiku',
'huggingface:Qwen/QwQ-32B',
'huggingface:Qwen/Qwen2.5-72B-Instruct',
'huggingface:Qwen/Qwen3-235B-A22B',
Expand Down
17 changes: 17 additions & 0 deletionspydantic_ai_slim/pydantic_ai/providers/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,6 +95,23 @@ def infer_provider(provider: str) -> Provider[Any]: # noqa: C901
from .cohere import CohereProvider

return CohereProvider()

elif provider == 'grok':
from .grok import GrokProvider

return GrokProvider()
elif provider == 'fireworks':
from .fireworks import FireworksProvider

return FireworksProvider()
elif provider == 'together':
from .together import TogetherProvider

return TogetherProvider()
elif provider == 'heroku':
from .heroku import HerokuProvider

return HerokuProvider()
elif provider == 'huggingface':
from .huggingface import HuggingFaceProvider

Expand Down
5 changes: 5 additions & 0 deletionstests/conftest.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -286,6 +286,11 @@ def huggingface_api_key() -> str:
return os.getenv('HF_TOKEN', 'mock-api-key') or os.getenv('HUGGINGFACE_API_KEY', 'mock-api-key')


@pytest.fixture(scope='session')
def heroku_inference_key() -> str:
return os.getenv('HEROKU_INFERENCE_KEY', 'mock-api-key')


@pytest.fixture(scope='session')
def bedrock_provider():
try:
Expand Down
2 changes: 2 additions & 0 deletionstests/models/test_model_names.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,6 +56,7 @@ def get_model_names(model_name_type: Any) -> Iterator[str]:
bedrock_names = [f'bedrock:{n}' for n in get_model_names(BedrockModelName)]
deepseek_names = ['deepseek:deepseek-chat', 'deepseek:deepseek-reasoner']
huggingface_names = [f'huggingface:{n}' for n in get_model_names(HuggingFaceModelName)]
heroku_names = get_heroku_model_names()
extra_names = ['test']

generated_names = sorted(
Expand All@@ -68,6 +69,7 @@ def get_model_names(model_name_type: Any) -> Iterator[str]:
+ bedrock_names
+ deepseek_names
+ huggingface_names
+ heroku_names
+ extra_names
)

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view thefull changes here.

[8]ページ先頭

©2009-2025 Movatter.jp