feat(provider): add Ambient as a built-in verified-inference provider#3389
Open
ambient-gregory wants to merge 1 commit into
Open
feat(provider): add Ambient as a built-in verified-inference provider#3389ambient-gregory wants to merge 1 commit into
ambient-gregory wants to merge 1 commit into
Conversation
Register Ambient as a built-in OpenAI-compatible provider. Models are sourced live from Ambient's /v1/models endpoint, so the catalog stays in sync with the upstream API without code changes. - provider.json: ambient entry (AMBIENT_API_KEY, OpenAI response type) - ProviderId::AMBIENT constant, display name, built-in registration, FromStr arm - Tests: from_str, display_name, built_in_providers, provider_repo config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Ambient as a built-in LLM provider in ForgeCode, exposing Ambient-hosted models through its OpenAI-compatible chat completions API.
Context
Ambient is a verified inference provider — every request is independently verified and the proof is posted on-chain, giving users cryptographic guarantees that the output came from the advertised model and weights. Verification is transparent to the client: no special headers or request fields are required.
The API itself is OpenAI-compatible (
https://api.ambient.xyz/v1/chat/completionsandhttps://api.ambient.xyz/v1/models), so this integration plugs into the existingOpenAIresponse type with no new transport code.Changes
crates/forge_repo/src/provider/provider.jsonambientprovider entry with OpenAI-compatible response typehttps://api.ambient.xyz/v1/chat/completionshttps://api.ambient.xyz/v1/models(driven live from the API, so the catalog stays in sync without code changes)AMBIENT_API_KEY)crates/forge_domain/src/provider.rsProviderId::AMBIENTconstantbuilt_in_providers()"Ambient"display-name mapping"ambient"arm toFromStrtest_ambient_from_str,test_ambient_display_name,test_ambient_in_built_in_providerstest_provider_id_display_nameandtest_codex_in_built_in_providersaggregate testscrates/forge_repo/src/provider/provider_repo.rstest_ambient_configcovering id, env var, response type, and URLHow to Use
forge provider login ambient→ enter your key/modelTesting
cargo test -p forge_domain -p forge_repo providerAll 269 existing provider tests pass; 4 new Ambient tests added and passing.