Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on the [DigitalOcean OpenAPI Specification](https://github.com/digitalocean/open
> **🚀 New in v0.29.0 — AI & Inference support**
>
> `pydo` now ships first-class support for DigitalOcean's
> [Gradient AI Platform](https://www.digitalocean.com/products/gradient): chat
> [Inference](https://docs.digitalocean.com/products/inference/) APIs: chat
> completions (with streaming), image generation, audio, batch inference, and
> model listing — all from the same `Client`. Jump to
> [**AI & Inference**](#ai--inference) to get started.
Expand Down Expand Up @@ -93,7 +93,7 @@ client = Client(token=os.getenv("DIGITALOCEAN_TOKEN"))
> | What you're calling | What you need |
> | --- | --- |
> | Infrastructure APIs (`droplets`, `ssh_keys`, `kubernetes`, `volumes`, …) | A DigitalOcean API token (PAT). |
> | Inference APIs (`chat`, `images`, `models`, `audio`, `batches`, `files`, `responses`) | A PAT created with **full access** scope, **or** a Gradient **Model Access Key**. |
> | Inference APIs (`chat`, `images`, `models`, `audio`, `batches`, `files`, `responses`) | A PAT created with **full access** scope, **or** a **Model Access Key**. |
>
> If you only have a limited-scope PAT, infra calls will work but inference
> calls will fail with a 401. To fix it, create a new PAT with full access,
Expand All @@ -103,7 +103,7 @@ client = Client(token=os.getenv("DIGITALOCEAN_TOKEN"))
> # All three of these work — pick the one you like:
> client = Client(token=os.environ["DIGITALOCEAN_TOKEN"]) # full-access PAT
> client = Client(api_key=os.environ["DIGITALOCEAN_TOKEN"]) # same thing, different name
> client = Client(api_key=os.environ["MODEL_ACCESS_KEY"]) # Gradient model access key
> client = Client(api_key=os.environ["MODEL_ACCESS_KEY"]) # model access key
> ```

#### Example of Using `pydo` to Access DO Resources
Expand Down Expand Up @@ -134,11 +134,12 @@ ID: 123457, NAME: my_prod_ssh_key, FINGERPRINT: eb:76:c7:2a:d3:3e:80:5d:ef:2e:ca

## **AI & Inference**

> Talk to models on DigitalOcean's Gradient AI Platform with the same
> `pydo.Client`.
> Talk to models on DigitalOcean's
> [Inference](https://docs.digitalocean.com/products/inference/) platform with
> the same `pydo.Client`.

The snippets below use a **DigitalOcean PAT created with full access scope**
(required for inference APIs). A Gradient Model Access Key works too — see
(required for inference APIs). A Model Access Key works too — see
the [credentials note](#pydo-quickstart) above.

There is also a separate namespace for inference: `from pydo.inference
Expand Down Expand Up @@ -459,8 +460,8 @@ Long term:

- The client currently inputs and outputs JSON dictionaries. Adding models would unlock features such as typing and validation.
- Add supporting functions to elevate customer experience (i.e. adding a funtion that surfaces IP address for a Droplet)
- **AI & Inference**: continue expanding coverage of the
[Gradient AI Platform](https://www.digitalocean.com/products/gradient)
- **AI & Inference**: continue expanding coverage of
[Inference](https://docs.digitalocean.com/products/inference/)
alongside the infrastructure APIs — keeping chat, images, audio, batches,
responses, agents, and model management feature-complete and idiomatic
from the same `pydo.Client`. `pydo` is an
Expand Down
2 changes: 1 addition & 1 deletion examples/gateway/async_invoke_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def main() -> None:
print("MCP URL:", session.url)

output = await session.tools.invoke_one(
"exa_web_search", {"query": "DigitalOcean Gradient", "max_results": 2}
"exa_web_search", {"query": "DigitalOcean Inference", "max_results": 2}
)
print("web_search output:", str(output)[:200])

Expand Down
2 changes: 1 addition & 1 deletion examples/gateway/invoke_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[
{
"tool": "exa_web_search",
"arguments": {"query": "DigitalOcean Gradient", "max_results": 3},
"arguments": {"query": "DigitalOcean Inference", "max_results": 3},
},
{
"tool": "exa_web_fetch",
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/chat_completion_stream.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Stream a chat completion from the Gradient AI Platform token-by-token.
"""Stream a chat completion from DigitalOcean Inference token-by-token.

Uses the inference-focused ``pydo.inference.Client`` entry point so the
top-level surface (``dir(client)``, IDE autocomplete) stays focused on
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/image_generation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Generate an image with the Gradient AI Platform and save it to disk.
"""Generate an image with DigitalOcean Inference and save it to disk.

Uses the inference-focused ``pydo.inference.Client`` entry point so the
top-level surface (``dir(client)``, IDE autocomplete) stays focused on
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/list_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""List every inference model available to the current Gradient account.
"""List every inference model available to the current DigitalOcean account.

Uses the inference-focused ``pydo.inference.Client`` entry point so the
top-level surface (``dir(client)``, IDE autocomplete) stays focused on
Expand Down
Loading