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
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
add more context to hugging face models page
  • Loading branch information
@burtenshaw
burtenshaw committedJul 9, 2025
commitd546e0453cd1fe95ad1641391d9dedfb72de8f20
12 changes: 8 additions & 4 deletionsdocs/models/huggingface.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
# Hugging Face

[Hugging Face](https://huggingface.co/) is an AI platform with all major open source models, datasets, MCPs, and demos. You can use [Inference Providers](https://huggingface.co/docs/inference-providers) to run open source models like DeepSeek R1 on scalable serverless infrastructure.

## Install

To use `HuggingFaceModel`, you need to either install `pydantic-ai`, or install `pydantic-ai-slim` with the `huggingface` optional group:
Expand All@@ -10,18 +12,20 @@ pip/uv-add "pydantic-ai-slim[huggingface]"

## Configuration

To use [HuggingFace](https://huggingface.co/) through their main API, go to
[Inference Providers documentation](https://huggingface.co/docs/inference-providers/pricing) for all the details,
and you can generate a Hugging Face access token here: https://huggingface.co/settings/tokens.
To use [HuggingFace](https://huggingface.co/) inference, you'll need to set up an account which will give you [free tier](https://huggingface.co/docs/inference-providers/pricing) allowance on [Inference Providers](https://huggingface.co/docs/inference-providers). To setup inference, follow these steps:

## Hugging Face access token
1. Go to [Hugging Face](https://huggingface.co/join) and sign up for an account.
2. Create a new access token in [Hugging Face](https://huggingface.co/settings/tokens).
3. Set the `HF_TOKEN` environment variable to the token you just created.

Once you have a Hugging Face access token, you can set it as an environment variable:

```bash
export HF_TOKEN='hf_token'
```

## Usage

You can then use [`HuggingFaceModel`][pydantic_ai.models.huggingface.HuggingFaceModel] by name:

```python
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp