Skip to content

style: test memory management clarifications#1233

Merged
mattklein123 merged 1 commit intomasterfrom
mattklein123-patch-1
Jul 10, 2017
Merged

style: test memory management clarifications#1233
mattklein123 merged 1 commit intomasterfrom
mattklein123-patch-1

Conversation

@mattklein123
Copy link
Member

No description provided.

@mattklein123
Copy link
Member Author

@lyft/network-team @dnoe @htuch @alyssawilk

@mattklein123 mattklein123 merged commit 28c5533 into master Jul 10, 2017
@mattklein123 mattklein123 deleted the mattklein123-patch-1 branch July 10, 2017 15:33
mathetake added a commit that referenced this pull request Mar 3, 2026
**Description**

This implements automatic configuration generation for `aigw run` when
there is no config file and at least the `OPENAI_API_KEY` environment
variables is set.

This makes it easier to get started with OpenAI-compatible backends
without writing or copy/pasting YAML configuration.

Configuration:

When `OPENAI_API_KEY` is set and no config file is provided, `aigw run`
will read these variables and generate configuration from them:
- `OPENAI_API_KEY`: API key for authentication (required)
- `OPENAI_BASE_URL`: Base URL for the backend (defaults to
https://api.openai.com/v1)

Key features:
- Automatic localhost to 127.0.0.1.nip.io conversion for Docker/K8s
- TLS detection based on URL scheme (https) e.g. Tetrate Agent Router
Service: https://api.router.tetrate.ai/v1
- Support for custom API path prefixes e.g. OpenRouter:
https://openrouter.ai/api/v1 or LlamaStack:
http://localhost:8321/v1/openai/v1
- Clean YAML output (omits version (path prefix) field when it's "v1")

This simplifies common use cases:
- OpenAI: `OPENAI_API_KEY=sk-your-key aigw run`
- Ollama: `OPENAI_BASE_URL=http://localhost:11434/v1
OPENAI_API_KEY=unused aigw run`

Here's an example:
```bash
$  OPENAI_API_KEY=sk-not-tellin go run . run
looking up the latest patch for Envoy version 1.35
1.35.3 is already downloaded
starting: /tmp/envoy-gateway/versions/1.35.3/bin/envoy in run directory /tmp/envoy-gateway/runs/1758789738364346000
[2025-09-25 16:42:18.391][48486493][warning][config] [source/server/options_impl_platform_default.cc:9] CPU number provided by HW thread count (instead of cpuset).
{"bytes_received":124,"bytes_sent":795,"connection_termination_details":null,"downstream_local_address":"127.0.0.1:1975","downstream_remote_address":"127.0.0.1:62691","duration":3635,"genai_backend_name":"default/openai/route/aigw-run/rule/0/ref/0","genai_model_name":"gpt-5-nano","genai_model_name_override":"gpt-5-nano","genai_tokens_input":21,"genai_tokens_output":268,"method":"POST","response_code":200,"start_time":"2025-09-25T08:43:07.390Z","upstream_cluster":"httproute/default/aigw-run/rule/0","upstream_host":"162.159.140.245:443","upstream_local_address":"192.168.0.108:62692","upstream_transport_failure_reason":null,"user-agent":"curl/8.14.1","x-envoy-origin-path":"/v1/chat/completions","x-request-id":"9daf1c85-f75e-4c88-a90c-f9cccf85970c"}
```

Fixes #1211

---------

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com>
Co-authored-by: Anuraag (Rag) Agrawal <anuraaga@gmail.com>
Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants