mirror of
https://github.com/dzhng/deep-research.git
synced 2025-12-26 04:48:06 +08:00
simplified and added note about custom models
This commit is contained in:
parent
f3cc28c2de
commit
fad3022657
@ -143,6 +143,15 @@ If you have a paid version of Firecrawl or a local version, feel free to increas
|
||||
|
||||
If you have a free version, you may sometime run into rate limit errors, you can reduce the limit (but it will run a lot slower).
|
||||
|
||||
### Custom endpoints and models
|
||||
|
||||
There are 2 other optional env vars that lets you tweak the endpoint (for other OpenAI compatible APIs like OpenRouter or Gemini) as well as the model string.
|
||||
|
||||
```bash
|
||||
OPENAI_ENDPOINT="custom_endpoint"
|
||||
OPENAI_MODEL="custom_model"
|
||||
```
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Initial Setup**
|
||||
|
||||
@ -14,31 +14,15 @@ const openai = createOpenAI({
|
||||
} as CustomOpenAIProviderSettings);
|
||||
|
||||
const isCustomEndpoint =
|
||||
process.env.OPENAI_ENDPOINT &&
|
||||
process.env.OPENAI_ENDPOINT !== 'https://api.openai.com/v1';
|
||||
process.env.OPENAI_ENDPOINT && process.env.OPENAI_ENDPOINT !== 'https://api.openai.com/v1';
|
||||
const customModel = process.env.OPENAI_MODEL;
|
||||
|
||||
// Models
|
||||
|
||||
export const gpt4Model = openai(
|
||||
isCustomEndpoint && customModel ? customModel : 'gpt-4o',
|
||||
{
|
||||
structuredOutputs: true,
|
||||
},
|
||||
);
|
||||
export const gpt4MiniModel = openai(
|
||||
isCustomEndpoint && customModel ? customModel : 'gpt-4o-mini',
|
||||
{
|
||||
structuredOutputs: true,
|
||||
},
|
||||
);
|
||||
export const o3MiniModel = openai(
|
||||
isCustomEndpoint && customModel ? customModel : 'o3-mini',
|
||||
{
|
||||
reasoningEffort: 'medium',
|
||||
structuredOutputs: true,
|
||||
},
|
||||
);
|
||||
export const o3MiniModel = openai(isCustomEndpoint && customModel ? customModel : 'o3-mini', {
|
||||
reasoningEffort: 'medium',
|
||||
structuredOutputs: true,
|
||||
});
|
||||
|
||||
const MinChunkSize = 140;
|
||||
const encoder = getEncoding('o200k_base');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user