Skip to main content

AI Providers

Estimated read~3-5 min
TL;DR
  • Choose provider and model: Python requires provider and model on every generate() call. The interactive CLI saves a selection in Settings; direct CLI flags override saved values. CircuitGen does not choose a default provider or model.
  • Provide a key: Python accepts api_key= or the provider's environment variable; the explicit parameter wins. Python does not read CLI-saved keys. The CLI checks the environment first, then its OS credential store.
  • Shell examples: In PowerShell, set $env:PROVIDER_KEY_VARIABLE="YOUR_API_KEY"; in Bash, use export PROVIDER_KEY_VARIABLE="YOUR_API_KEY". Replace the variable name with the one listed for your provider.
  • Other Python options: Load a project .env file with python-dotenv, or pass a key from a secret manager with api_key=. CircuitGen does not load .env files itself.
  • Request defaults: Timeout is 120 seconds. Python retries and clarifications are off by default; CLI Settings enable both. CircuitGen does not switch models automatically and makes at most two netlist correction attempts.

Supported Providers​

Each provider needs its own account and API key. Select a provider name to open its official key page.

ProviderIDKey variableAPI keys
Google GeminigeminiGEMINI_API_KEYGoogle AI Studio
OpenAIopenaiOPENAI_API_KEYOpenAI Platform
AnthropicanthropicANTHROPIC_API_KEYAnthropic Console
DeepSeekdeepseekDEEPSEEK_API_KEYDeepSeek Platform
GroqgroqGROQ_API_KEYGroq Console
MistralmistralMISTRAL_API_KEYMistral Console
xAIxaiXAI_API_KEYxAI Console
OpenRouteropenrouterOPENROUTER_API_KEYOpenRouter
Together AItogetherTOGETHER_API_KEYTogether AI
Fireworks AIfireworksFIREWORKS_API_KEYFireworks AI
CerebrascerebrasCEREBRAS_API_KEYCerebras Cloud

Configure a provider​

CircuitGen does not pick a provider or model automatically. Choose both for each Python call, or save them in CLI Settings. Use a model ID returned by the provider's model list or shown in its API documentation. A model appearing in the list does not guarantee that your account can use it for every request.

  1. Run circuit and open Settings → AI Providers. On first launch, choose Set up AI generation instead.
  2. Select a provider.
  3. Choose Manage API key to enter a key. Select Verify and save key to test it, or Save without verification to store it in the operating system's secure credential store.
  4. Choose Browse models to list models available to the key, or enter a model ID and save it.
  5. Use Test connection to check the key. This tests authentication; it does not guarantee every model request will work.

If a provider environment variable is set, CircuitGen uses it before a key saved in the secure store. Keys entered in CLI Settings are not used by the Python library.

Request settings​

  • Timeout: timeout defaults to 120 seconds and must be greater than 0 and at most 600 seconds. Change it with timeout=60, for example. CLI Settings use the same 120-second default.
  • Retry temporary errors: Python's retry_transient defaults to False; CLI Settings default to on. When enabled, CircuitGen makes one extra request for eligible temporary errors.
  • Clarifications: Python's clarify defaults to False; CLI Settings default to on. When enabled, the provider may ask one short question when essential wiring details are unclear.
  • Model fallback: CircuitGen does not automatically switch to another model. Select a model available to your account.
  • Netlist correction: If a generated netlist fails validation, CircuitGen can make up to two correction attempts after the initial response. This limit is fixed.

Review generated values and connections before using a schematic. Validation and rendering do not guarantee that a circuit will operate as intended.