Skip to content

Model Catalog Migration 7/7: Guides & Tutorials#621

Merged
siddharthsambharia-portkey merged 4 commits intomainfrom
migration/07-guides
Feb 4, 2026
Merged

Model Catalog Migration 7/7: Guides & Tutorials#621
siddharthsambharia-portkey merged 4 commits intomainfrom
migration/07-guides

Conversation

@roh26it
Copy link
Contributor

@roh26it roh26it commented Dec 10, 2025

Model Catalog Migration - Guides & Tutorials

What's changing

Step-by-step guides and tutorials updated for Model Catalog flow.

Files changed (24)

Getting Started (Major):

File Changes
getting-started-with-ai-gateway.mdx +584/-998 (Core onboarding)
101-on-portkey-s-gateway-configs.mdx +40/-99
image-generation.mdx +34/-112
llama-3-on-groq.mdx +27/-67
tackling-rate-limiting.mdx +25/-49

Integration Guides (6):

  • groq.mdx, vercel-ai.mdx, arize-portkey.mdx
  • langchain.mdx, llama-3-on-portkey-+-together-ai.mdx, mixtral-8x22b.mdx

Use Cases (10):

  • Fallbacks, JSON schema, few-shot prompting, DeepSeek R1
  • Supabase + PGVector, cost tracking, and more

Prompts (2):

  • build-a-chatbot-using-portkeys-prompt-templates.mdx
  • llama-prompts.mdx

API Reference (1):

  • config-object.mdx

Review checklist

  • Step numbers match actual UI flow
  • Code snippets use new @provider/model format
  • Links to Model Catalog are correct
  • User journey makes sense for newcomers

Risk: 🟡 Medium

User-facing tutorials - important for onboarding.

Part of

Model Catalog Migration - Split from #597 for easier review


🎉 This is the final PR in the migration series!

Update step-by-step guides and tutorials:
- Getting Started guides (core onboarding)
- Integration guides (Groq, Vercel AI, Arize, LangChain, etc.)
- Use case guides (fallbacks, JSON schema, few-shot, etc.)
- Prompt guides (chatbot, llama prompts)
- API reference config object
@siddharthsambharia-portkey
Copy link
Contributor

siddharthsambharia-portkey commented Feb 4, 2026

in all thse files wherever we are passing a dummy value for API key

client = OpenAI(
    api_key="X",
    base_url=PORTKEY_GATEWAY_URL,
    default_headers=createHeaders(
        api_key=userdata.get("PORTKEY_API_KEY"),
        config=config
    )
)

like this case above

it shoud be

client = OpenAI(
    api_key=userdata.get("PORTKEY_API_KEY"),
    base_url=PORTKEY_GATEWAY_URL,
    default_headers=createHeaders(
        config=config
    )
)

Portkey works iwth OpeAI client natively and we don't need to pass the API Key as a separete header

make sur ethis is different from

client = OpenAI(
    api_key=userdata.get('GROQ_API_KEY'),  # replace with your Groq API key
    base_url=PORTKEY_GATEWAY_URL,
    default_headers=createHeaders(
        provider="groq",
        api_key=userdata.get('PORTKEY_API_KEY')  # replace with your Portkey API key
    )
)

in this case we need portkey API key separetely because we are using provider api key natively without and AI provider slug from portkey

so we do need thte default header separately

When using configs or provider slugs from Model Catalog, Portkey
works natively with OpenAI client and the API key should be passed
directly to the api_key parameter instead of in createHeaders.

Addresses PR #621 review comment.
@siddharthsambharia-portkey
Copy link
Contributor

Addressed the API key pattern issue across all files:

Fixed files:

  • guides/use-cases/fallback-from-sdxl-to-dall-e-3.mdx
  • guides/use-cases/comparing-top10-lmsys-models-with-portkey.mdx
  • guides/integrations/langchain.mdx
  • guides/integrations/groq.mdx
  • guides/getting-started/image-generation.mdx

Changes made:
When using configs or provider slugs from Model Catalog, the Portkey API key is now passed directly to the api_key parameter instead of in headers:

client = OpenAI(
    api_key=PORTKEY_API_KEY,  # Portkey API key goes here
    base_url=PORTKEY_GATEWAY_URL,
    default_headers=createHeaders(
        config=config  # No api_key needed in headers
    )
)

Note: Files using provider API keys directly (like the Groq example with GROQ_API_KEY) still correctly keep the Portkey API key in headers.

- 101-on-portkey-s-gateway-configs.mdx: Remove duplicate apiKey from
  defaultHeaders, fix api_key pattern, update gpt-4 to gpt-5-mini
- arize-portkey.mdx: Change model to @openai-prod/gpt-4 format
- run-portkey-on-prompts-from-langchain-hub.mdx: Remove excess whitespace,
  update model references to gpt-5-mini
- librechat-web-search.mdx: Remove override_params from config, move
  model to yaml models list, update to latest models (gpt-5, claude-4.5-sonnet, llama-4)
- tackling-rate-limiting.mdx: Replace virtual keys with model catalog
  pattern, update to newer models
- Refactor the JSON schema for the config object to enhance clarity and organization.
- Ensure all properties are accurately defined and structured for better validation.
- Improve documentation for better understanding of configuration options.
@siddharthsambharia-portkey siddharthsambharia-portkey merged commit ad211cf into main Feb 4, 2026
3 checks passed
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