AI Features
AI Providers
Shiro ships three built-in provider implementations: OpenAI-compatible (cloud or self-hosted), Ollama (local models), and Gemini (Google AI Studio and Vertex AI). All implement the same Provider interface so they are interchangeable in workflow steps.
openai
cloud / self-hostedAny API that speaks the OpenAI /v1/chat/completions protocol — OpenAI, Azure OpenAI, vLLM, LM Studio, Groq, Together AI, etc.
- • Requires
api_key - • Default base URL:
https://api.openai.com/v1 - • Supports custom headers
- • Optional
skip_tls_verifyfor self-signed certs - • Streaming supported
ollama
localLocal model server via Ollama. No API key required — ideal for air-gapped or private environments.
- • No
api_keyneeded - • Default base URL:
http://localhost:11434 - • Uses
/api/chatendpoint - • Streaming supported
- • Pull models with
ollama pull <model>
gemini
Google AIGoogle's Gemini models via Google AI Studio or Vertex AI. Supports Gemini 1.5 Pro and other Gemini models.
- • Requires
api_key - • Two modes: Google AI Studio (API key) or Vertex AI (OAuth)
- • Supports streaming
- • Multi-modal support (text, images, code)
- • Configurable project ID and location for Vertex AI
OpenAI Provider Config
.shiro/config.yaml
models:
gpt-4o:
provider: openai
model: gpt-4o
base_url: https://api.openai.com/v1
api_key: "{{env.OPENAI_API_KEY}}"
timeout: 60
# Azure OpenAI
azure-gpt4:
provider: openai
model: gpt-4
base_url: https://YOUR_RESOURCE.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT
api_key: "{{env.AZURE_OPENAI_KEY}}"
# vLLM / LM Studio / Groq etc.
groq-llama:
provider: openai
model: llama3-8b-8192
base_url: https://api.groq.com/openai/v1
api_key: "{{env.GROQ_API_KEY}}"| Field | Description |
|---|---|
model | Model name as accepted by the API (e.g. gpt-4o, gpt-4-turbo) |
base_url | Override endpoint. Default: https://api.openai.com/v1 |
api_key | Bearer token sent as Authorization header |
timeout | Request timeout in seconds (default: 30) |
skip_tls_verify | Disable TLS cert check — useful for internal servers with self-signed certs |
headers | Map of extra HTTP headers to include in requests |
Ollama Provider Config
.shiro/config.yaml
models:
codellama:
provider: ollama
model: codellama:34b
base_url: http://localhost:11434
timeout: 120 # longer timeout for local inference
llama3:
provider: ollama
model: llama3:8b # faster, less capable
mistral:
provider: ollama
model: mistral:7bPull a model before running workflows:
bash
ollama pull codellama:34b
ollama pull llama3:8bGemini Provider Config
.shiro/config.yaml
models:
# Gemini (Google AI Studio)
gemini:
provider: gemini
model: gemini-1.5-pro
api_key: "{{env.GEMINI_API_KEY}}"
api_type: "google-ai-studio"
# Gemini (Vertex AI)
gemini-vertex:
provider: gemini
model: gemini-1.5-pro
api_key: "{{env.GOOGLE_ACCESS_TOKEN}}"
api_type: "vertex-ai"
project_id: "{{env.GOOGLE_PROJECT_ID}}"
location: "us-central1"| Field | Description |
|---|---|
model | Model name (e.g. gemini-1.5-pro, gemini-1.5-flash) |
api_key | API key for Google AI Studio or access token for Vertex AI |
api_type | Either 'google-ai-studio' (API key) or 'vertex-ai' (OAuth) |
project_id | Google Cloud project ID (required for Vertex AI) |
location | Vertex AI location (e.g. us-central1, required for Vertex AI) |
Provider Interface
All providers implement the same Go interface — they are fully interchangeable. See the API Contract for details.
go
type Provider interface {
Generate(ctx context.Context, req *GenerateRequest) (*GenerateResponse, error)
Stream(ctx context.Context, req *GenerateRequest) (<-chan StreamChunk, error)
Close() error
}
type GenerateRequest struct {
Model string // Model name
Messages []Message // Chat messages
System string // System prompt
Temperature float64
MaxTokens int
TopP float64
}