Skip to content

Commit 659b8d9

Browse files
docs(aigw): README and docker-compose updates for image generation (gpt-image-1-mini 1024x1024 low); align examples and services
Signed-off-by: Hrushikesh Patil <[email protected]>
1 parent 1f2b0d2 commit 659b8d9

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

cmd/aigw/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ Here are values we use for Ollama:
7474
-X POST http://localhost:1975/v1/images/generations \
7575
-H "Authorization: Bearer unused" \
7676
-H "Content-Type: application/json" \
77-
-d '{"model":"dall-e-2","prompt":"A watercolor painting of a red fox in a birch forest","size":"512x512"}' \
77+
-d '{"model":"gpt-image-1-mini","prompt":"A watercolor painting of a red fox in a birch forest","size":"1024x1024","quality":"low"}' \
7878
| jq -r '.data[0].b64_json' | base64 -d > image.png
7979
```
8080
8181
4. **Create embeddings**:
8282
83-
The `create-embeddings` service uses `curl` to send an embeddings request
83+
The `embeddings` service uses `curl` to send an embeddings request
8484
to the AI Gateway CLI (aigw) which routes it to Ollama.
8585
8686
```bash
87-
docker compose run --rm create-embeddings
87+
docker compose run --rm embeddings
8888
```
8989
9090
5. **Shutdown the example stack**:
@@ -179,7 +179,7 @@ This configures the OTLP endpoint to otel-tui on port 4318.
179179
180180
```bash
181181
COMPOSE_PROFILES="<profile>" docker compose -f docker-compose-otel.yaml run --build --rm chat-completion
182-
COMPOSE_PROFILES="<profile>" docker compose -f docker-compose-otel.yaml run --build --rm create-embeddings
182+
COMPOSE_PROFILES="<profile>" docker compose -f docker-compose-otel.yaml run --build --rm embeddings
183183
COMPOSE_PROFILES="<profile>" docker compose -f docker-compose-otel.yaml run --build --rm mcp
184184
# Image generation
185185
COMPOSE_PROFILES="<profile>" docker compose -f docker-compose-otel.yaml run --build --rm image-generation

cmd/aigw/docker-compose-otel.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ services:
105105
- OPENAI_BASE_URL=http://aigw:1975/v1
106106
- OPENAI_API_KEY=unused
107107

108-
# create-embeddings is the standard OpenAI client (`openai` in pip), instrumented
108+
# embeddings is the standard OpenAI client (`openai` in pip), instrumented
109109
# with the following OpenTelemetry instrumentation libraries:
110110
# - openinference-instrumentation-openai (embeddings spans)
111111
# - opentelemetry-instrumentation-httpx (HTTP client spans and trace headers)
112-
create-embeddings:
112+
embeddings:
113113
build:
114114
context: ../../tests/internal/testopeninference
115115
dockerfile: Dockerfile.openai_client
116116
target: create-embeddings
117-
container_name: create-embeddings
117+
container_name: embeddings
118118
profiles: ["test"]
119119
env_file:
120120
- ../../.env.ollama
@@ -144,3 +144,21 @@ services:
144144
- flyTo=LAX
145145
- --tool-arg
146146
- departureDate=15/12/2025
147+
148+
# image-generation is a simple curl-based test client for sending image
149+
# generation requests to aigw.
150+
image-generation:
151+
image: golang:1.25
152+
container_name: image-generation
153+
profiles: ["test"]
154+
env_file:
155+
- ../../.env.ollama
156+
command:
157+
- sh
158+
- -c
159+
- |
160+
curl -s -w %{http_code} \
161+
-X POST http://aigw:1975/v1/images/generations \
162+
-H "Authorization: Bearer unused" \
163+
-H "Content-Type: application/json" \
164+
-d "{\"model\":\"$$IMAGE_GENERATION_MODEL\",\"prompt\":\"A watercolor painting of a red fox in a birch forest\",\"size\":\"1024x1024\",\"quality\":\"low\"}"

cmd/aigw/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,6 @@ services:
152152
-X POST http://aigw:1975/v1/images/generations \
153153
-H "Authorization: Bearer unused" \
154154
-H "Content-Type: application/json" \
155-
-d "{\"model\":\"$$IMAGE_GENERATION_MODEL\",\"prompt\":\"A watercolor painting of a red fox in a birch forest\",\"size\":\"256x256\"}"
155+
-d "{\"model\":\"$$IMAGE_GENERATION_MODEL\",\"prompt\":\"A watercolor painting of a red fox in a birch forest\",\"size\":\"1024x1024\",\"quality\":\"low\"}"
156156
extra_hosts: # localhost:host-gateway trick doesn't work with aigw
157157
- "host.docker.internal:host-gateway"

0 commit comments

Comments
 (0)