first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:52:23 +03:00
commit 880f412e2c
2662 changed files with 866266 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
# OpenAI Integration Audio Schemas (Speech and Transcription)
# Speech (TTS) Request
OpenAISpeechRequest:
type: object
required:
- model
- input
properties:
model:
type: string
description: Model identifier (e.g., tts-1, tts-1-hd)
example: tts-1
input:
type: string
description: Text to convert to speech
voice:
type: string
description: Voice to use
enum: [alloy, echo, fable, onyx, nova, shimmer]
response_format:
type: string
enum: [mp3, opus, aac, flac, wav, pcm]
speed:
type: number
minimum: 0.25
maximum: 4.0
stream_format:
type: string
enum: [sse]
description: Set to 'sse' for streaming
# Bifrost-specific
fallbacks:
type: array
items:
type: string
# Transcription Request
OpenAITranscriptionRequest:
type: object
required:
- model
- file
properties:
model:
type: string
description: Model identifier (e.g., whisper-1)
example: whisper-1
file:
type: string
format: binary
description: Audio file to transcribe
language:
type: string
description: Language of the audio (ISO 639-1)
prompt:
type: string
description: Prompt to guide transcription
response_format:
type: string
enum: [json, text, srt, verbose_json, vtt]
temperature:
type: number
minimum: 0
maximum: 1
timestamp_granularities:
type: array
items:
type: string
enum: [word, segment]
stream:
type: boolean
# Bifrost-specific
fallbacks:
type: array
items:
type: string
# Responses reuse inference schemas
OpenAISpeechResponse:
$ref: '../../inference/speech.yaml#/SpeechResponse'
OpenAISpeechStreamResponse:
$ref: '../../inference/speech.yaml#/SpeechStreamResponse'
OpenAITranscriptionResponse:
$ref: '../../inference/transcription.yaml#/TranscriptionResponse'
OpenAITranscriptionStreamResponse:
$ref: '../../inference/transcription.yaml#/TranscriptionStreamResponse'

View File

@@ -0,0 +1,57 @@
# OpenAI Integration Batch API Schemas
# Reuses inference batch schemas since OpenAI integration uses Bifrost format
# Batch Create Request - uses Bifrost format with provider field
OpenAIBatchCreateRequest:
$ref: '../../inference/batch.yaml#/BatchCreateRequest'
OpenAIBatchCreateResponse:
$ref: '../../inference/batch.yaml#/BatchCreateResponse'
OpenAIBatchListRequest:
type: object
properties:
limit:
type: integer
description: Maximum number of batches to return
default: 30
after:
type: string
description: Cursor for pagination
provider:
type: string
description: Filter by provider
example: openai
OpenAIBatchListResponse:
$ref: '../../inference/batch.yaml#/BatchListResponse'
OpenAIBatchRetrieveRequest:
type: object
required:
- batch_id
properties:
batch_id:
type: string
description: Batch ID to retrieve
provider:
type: string
description: Provider for the batch
OpenAIBatchRetrieveResponse:
$ref: '../../inference/batch.yaml#/BatchRetrieveResponse'
OpenAIBatchCancelRequest:
type: object
required:
- batch_id
properties:
batch_id:
type: string
description: Batch ID to cancel
provider:
type: string
description: Provider for the batch
OpenAIBatchCancelResponse:
$ref: '../../inference/batch.yaml#/BatchCancelResponse'

View File

@@ -0,0 +1,121 @@
# OpenAI Integration Chat Completions Schemas
# Reuses inference schemas where possible since Bifrost follows OpenAI format
OpenAIChatRequest:
type: object
required:
- model
- messages
properties:
model:
type: string
description: Model identifier (e.g., gpt-4, gpt-3.5-turbo)
example: gpt-4
messages:
type: array
items:
$ref: '#/OpenAIMessage'
description: List of messages in the conversation
stream:
type: boolean
description: Whether to stream the response
max_tokens:
type: integer
description: Maximum tokens to generate (legacy, use max_completion_tokens)
max_completion_tokens:
type: integer
description: Maximum tokens to generate
temperature:
type: number
minimum: 0
maximum: 2
top_p:
type: number
frequency_penalty:
type: number
minimum: -2.0
maximum: 2.0
presence_penalty:
type: number
minimum: -2.0
maximum: 2.0
logit_bias:
type: object
additionalProperties:
type: number
logprobs:
type: boolean
top_logprobs:
type: integer
n:
type: integer
stop:
oneOf:
- type: string
- type: array
items:
type: string
seed:
type: integer
user:
type: string
tools:
type: array
items:
$ref: '../../inference/chat.yaml#/ChatTool'
tool_choice:
$ref: '../../inference/chat.yaml#/ChatToolChoice'
parallel_tool_calls:
type: boolean
response_format:
type: object
description: Format for the response
reasoning_effort:
type: string
enum: [none, minimal, low, medium, high, xhigh]
description: OpenAI reasoning effort level
service_tier:
type: string
stream_options:
$ref: '../../inference/chat.yaml#/ChatStreamOptions'
# Bifrost-specific
fallbacks:
type: array
items:
type: string
description: Fallback models
OpenAIMessage:
type: object
required:
- role
properties:
role:
type: string
enum: [system, user, assistant, tool, developer]
name:
type: string
content:
$ref: '../../inference/chat.yaml#/ChatMessageContent'
tool_call_id:
type: string
description: For tool messages
refusal:
type: string
reasoning:
type: string
annotations:
type: array
items:
$ref: '../../inference/chat.yaml#/ChatAssistantMessageAnnotation'
tool_calls:
type: array
items:
$ref: '../../inference/chat.yaml#/ChatAssistantMessageToolCall'
# Response reuses inference schema since format is identical
OpenAIChatResponse:
$ref: '../../inference/chat.yaml#/ChatCompletionResponse'
OpenAIChatStreamResponse:
$ref: '../../inference/chat.yaml#/ChatCompletionStreamResponse'

View File

@@ -0,0 +1,51 @@
# OpenAI Integration Common Types
OpenAIError:
type: object
properties:
error:
type: object
properties:
message:
type: string
type:
type: string
param:
type: string
nullable: true
code:
type: string
nullable: true
# OpenAI uses the same model format but without provider prefix
OpenAIModel:
type: object
properties:
id:
type: string
description: Model identifier
object:
type: string
default: model
owned_by:
type: string
created:
type: integer
format: int64
active:
type: boolean
description: GROQ-specific field
context_window:
type: integer
description: GROQ-specific field
OpenAIListModelsResponse:
type: object
properties:
object:
type: string
default: list
data:
type: array
items:
$ref: '#/OpenAIModel'

View File

@@ -0,0 +1,36 @@
# OpenAI Integration Embeddings Schemas
OpenAIEmbeddingRequest:
type: object
required:
- model
- input
properties:
model:
type: string
description: Model identifier
example: text-embedding-3-small
input:
oneOf:
- type: string
- type: array
items:
type: string
description: Input text to embed
encoding_format:
type: string
enum: [float, base64]
dimensions:
type: integer
description: Number of dimensions for the embedding
user:
type: string
# Bifrost-specific
fallbacks:
type: array
items:
type: string
# Response reuses inference schema
OpenAIEmbeddingResponse:
$ref: '../../inference/embeddings.yaml#/EmbeddingResponse'

View File

@@ -0,0 +1,95 @@
# OpenAI Integration Files API Schemas
# Reuses inference files schemas since OpenAI integration uses Bifrost format
OpenAIFileUploadRequest:
type: object
required:
- file
- purpose
properties:
file:
type: string
format: binary
description: File to upload
purpose:
type: string
enum: [assistants, assistants_output, batch, batch_output, fine-tune, fine-tune-results, vision, user_data, evals]
description: Purpose of the file
provider:
type: string
description: Provider for file storage
storage_config:
$ref: '../../inference/files.yaml#/FileStorageConfig'
OpenAIFileUploadResponse:
$ref: '../../inference/files.yaml#/FileUploadResponse'
OpenAIFileListRequest:
type: object
properties:
purpose:
type: string
description: Filter by purpose
limit:
type: integer
description: Maximum files to return
after:
type: string
description: Cursor for pagination
order:
type: string
enum: [asc, desc]
provider:
type: string
description: Filter by provider
OpenAIFileListResponse:
$ref: '../../inference/files.yaml#/FileListResponse'
OpenAIFileRetrieveRequest:
type: object
required:
- file_id
properties:
file_id:
type: string
description: File ID to retrieve
provider:
type: string
description: Provider for the file
storage_config:
$ref: '../../inference/files.yaml#/FileStorageConfig'
OpenAIFileRetrieveResponse:
$ref: '../../inference/files.yaml#/FileRetrieveResponse'
OpenAIFileDeleteRequest:
type: object
required:
- file_id
properties:
file_id:
type: string
description: File ID to delete
provider:
type: string
description: Provider for the file
storage_config:
$ref: '../../inference/files.yaml#/FileStorageConfig'
OpenAIFileDeleteResponse:
$ref: '../../inference/files.yaml#/FileDeleteResponse'
OpenAIFileContentRequest:
type: object
required:
- file_id
properties:
file_id:
type: string
description: File ID to get content for
provider:
type: string
description: Provider for the file
storage_config:
$ref: '../../inference/files.yaml#/FileStorageConfig'

View File

@@ -0,0 +1,133 @@
# OpenAI Integration - Image Generation Schemas
OpenAIImageGenerationRequest:
type: object
required:
- model
- prompt
properties:
model:
type: string
description: Model identifier
prompt:
type: string
description: Text prompt to generate image
n:
type: integer
minimum: 1
maximum: 10
default: 1
description: Number of images to generate
size:
type: string
enum:
- "256x256"
- "512x512"
- "1024x1024"
- "1792x1024"
- "1024x1792"
- "1536x1024"
- "1024x1536"
- "auto"
description: Size of the generated image
quality:
type: string
enum:
- "standard"
- "hd"
description: Quality of the generated image
style:
type: string
enum:
- "natural"
- "vivid"
description: Style of the generated image
response_format:
type: string
enum:
- "url"
- "b64_json"
default: "url"
description: Format of the response. This parameter is not supported for streaming requests.
user:
type: string
description: User identifier for tracking
stream:
type: boolean
default: false
description: |
Whether to stream the response. When true, images are sent as base64 chunks via SSE.
fallbacks:
type: array
items:
type: string
description: Fallback models to try if primary model fails
OpenAIImageGenerationResponse:
type: object
properties:
created:
type: integer
format: int64
description: Unix timestamp when the image was created
data:
type: array
items:
$ref: '../../../schemas/inference/images.yaml#/ImageData'
description: Array of generated images
background:
type: string
description: Background type used
output_format:
type: string
description: Output format used
quality:
type: string
description: Quality setting used
size:
type: string
description: Size setting used
usage:
$ref: '../../../schemas/inference/images.yaml#/ImageUsage'
OpenAIImageStreamResponse:
type: object
description: |
Streaming response chunk for image generation (OpenAI format).
Sent via Server-Sent Events (SSE) when stream=true.
properties:
type:
type: string
enum:
- "image_generation.partial_image"
- "image_generation.completed"
- "error"
description: Type of stream event
b64_json:
type: string
description: Base64-encoded chunk of image data
partial_image_index:
type: integer
description: Index of the partial image chunk
sequence_number:
type: integer
description: Ordering index for stream chunks
created_at:
type: integer
format: int64
description: Timestamp when chunk was created
size:
type: string
description: Size of the generated image
quality:
type: string
description: Quality setting used
background:
type: string
description: Background type used
output_format:
type: string
description: Output format used
usage:
$ref: '../../../schemas/inference/images.yaml#/ImageUsage'
description: Token usage (usually in final chunk)

View File

@@ -0,0 +1,108 @@
# OpenAI Integration Responses API Schemas
OpenAIResponsesRequest:
type: object
required:
- model
- input
properties:
model:
type: string
description: Model identifier
example: gpt-4
input:
$ref: '#/OpenAIResponsesInput'
stream:
type: boolean
instructions:
type: string
description: System instructions for the model
max_output_tokens:
type: integer
metadata:
type: object
additionalProperties: true
parallel_tool_calls:
type: boolean
previous_response_id:
type: string
reasoning:
$ref: '#/OpenAIResponsesReasoning'
store:
type: boolean
temperature:
type: number
minimum: 0
maximum: 2
text:
$ref: '#/OpenAIResponsesTextConfig'
tool_choice:
$ref: '../../inference/responses.yaml#/ResponsesToolChoice'
tools:
type: array
items:
$ref: '../../inference/responses.yaml#/ResponsesTool'
top_p:
type: number
truncation:
type: string
enum: [auto, disabled]
user:
type: string
# Bifrost-specific
fallbacks:
type: array
items:
type: string
OpenAIResponsesInput:
oneOf:
- type: string
- type: array
items:
$ref: '../../inference/responses.yaml#/ResponsesMessage'
description: Input - can be a string or array of messages
OpenAIResponsesReasoning:
type: object
properties:
effort:
type: string
enum: [none, minimal, low, medium, high, xhigh]
generate_summary:
type: string
enum: [auto, concise, detailed]
summary:
type: string
enum: [auto, concise, detailed]
max_tokens:
type: integer
OpenAIResponsesTextConfig:
type: object
properties:
format:
$ref: '#/OpenAIResponsesTextFormat'
OpenAIResponsesTextFormat:
type: object
properties:
type:
type: string
enum: [text, json_object, json_schema]
json_schema:
type: object
properties:
name:
type: string
schema:
type: object
strict:
type: boolean
# Response reuses inference schema
OpenAIResponsesResponse:
$ref: '../../inference/responses.yaml#/ResponsesResponse'
OpenAIResponsesStreamResponse:
$ref: '../../inference/responses.yaml#/ResponsesStreamResponse'

View File

@@ -0,0 +1,74 @@
# OpenAI Integration Text Completions Schemas (Legacy Completions API)
OpenAITextCompletionRequest:
type: object
required:
- model
- prompt
properties:
model:
type: string
description: Model identifier
example: gpt-3.5-turbo-instruct
prompt:
oneOf:
- type: string
- type: array
items:
type: string
description: The prompt(s) to generate completions for
stream:
type: boolean
description: Whether to stream the response
max_tokens:
type: integer
temperature:
type: number
minimum: 0
maximum: 2
top_p:
type: number
frequency_penalty:
type: number
minimum: -2.0
maximum: 2.0
presence_penalty:
type: number
minimum: -2.0
maximum: 2.0
logit_bias:
type: object
additionalProperties:
type: number
logprobs:
type: integer
n:
type: integer
stop:
oneOf:
- type: string
- type: array
items:
type: string
suffix:
type: string
echo:
type: boolean
best_of:
type: integer
user:
type: string
seed:
type: integer
# Bifrost-specific
fallbacks:
type: array
items:
type: string
# Response reuses inference schema
OpenAITextCompletionResponse:
$ref: '../../inference/text.yaml#/TextCompletionResponse'
OpenAITextCompletionStreamResponse:
$ref: '../../inference/text.yaml#/TextCompletionStreamResponse'