Skip to content
Merged

Dev #849

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
061d191
wip: use urql outside of react
MarcMcIntosh May 28, 2025
f17dd02
wio: getting the thread data from local server
MarcMcIntosh May 29, 2025
2fbde86
wip: render threads..
MarcMcIntosh May 30, 2025
8563ac4
wip(threads): handle deleting a thread.
MarcMcIntosh May 30, 2025
b7b0df2
wip: add thread create and message createion and subscription services
MarcMcIntosh Jun 2, 2025
0a16dba
wip: subscribe to messages
MarcMcIntosh Jun 2, 2025
c950a42
wip: add store fr thread messages
MarcMcIntosh Jun 3, 2025
f6c8568
wip(thread messages): add slice to store.
MarcMcIntosh Jun 3, 2025
ff96aa4
refactor: make generic craeteSubscription
MarcMcIntosh Jun 3, 2025
90e4550
wip(message trie): add a function to make a message trie.
MarcMcIntosh Jun 3, 2025
335f8b6
wip(threads): render messages in storybook
MarcMcIntosh Jun 3, 2025
32b9dda
wip: render messages in chat
MarcMcIntosh Jun 3, 2025
58b126d
refactor: fix types
MarcMcIntosh Jun 4, 2025
96e5f0f
refactor: fix some types.
MarcMcIntosh Jun 4, 2025
86a7be3
wip(messagetrie): track leaf node.
MarcMcIntosh Jun 4, 2025
73ad35c
wip: deltas
MarcMcIntosh Jun 5, 2025
7d0b6df
wip(deltas): use the key to infoer info about the detlas position
MarcMcIntosh Jun 5, 2025
93feaac
wip: handle createing a new thread with messages
MarcMcIntosh Jun 5, 2025
0df6129
sync with dev
MarcMcIntosh Jun 5, 2025
211cc03
wip: creating a new thread and sending messages
MarcMcIntosh Jun 5, 2025
28b36af
wip: context file component called
MarcMcIntosh Jun 5, 2025
90168c7
refact(thread creation): clean up a bit
MarcMcIntosh Jun 5, 2025
75b4820
add Qwen/Qwen3-235B-A22B
reymondzzzz Jun 6, 2025
88e59d1
wip: fixing type errors
MarcMcIntosh Jun 6, 2025
364d894
wip: type issues
MarcMcIntosh Jun 6, 2025
e4842d6
wip: fixing types
MarcMcIntosh Jun 6, 2025
6f64a34
fix types
MarcMcIntosh Jun 6, 2025
5fe5269
fix: format messages for lsp
MarcMcIntosh Jun 6, 2025
ee85773
fix: change data when opening a tthread
MarcMcIntosh Jun 6, 2025
9a28142
Refactor API requests to use direct API keys, remove global context d…
JegernOUTT Jun 9, 2025
1bd51b8
Refactor to handle Option type for current_model and toolset
JegernOUTT Jun 9, 2025
c6f1d86
Add thread creation and processing, refactor subchat module
JegernOUTT Jun 10, 2025
8f9f382
chore comment out the code for eagerly adding the raw message before …
MarcMcIntosh Jun 10, 2025
8689fe4
feat: message branches
MarcMcIntosh Jun 10, 2025
708dae1
ui: move branching button.
MarcMcIntosh Jun 10, 2025
c4e06b3
ui: branch buttons on large screen.
MarcMcIntosh Jun 10, 2025
43d8ae7
Make `subchat` module public and refactor subchat logic
JegernOUTT Jun 11, 2025
8350d1b
refactor: replace isWaiting and isStreaming selectors
MarcMcIntosh Jun 11, 2025
d92c7f8
fix: commented out the wrong export
MarcMcIntosh Jun 11, 2025
027e6a1
Refactor thread handling for improved error reporting and concurrency
JegernOUTT Jun 11, 2025
3bc206f
Refactor thread event processing by inlining closure logic
JegernOUTT Jun 11, 2025
1ce2547
Remove unused constants and tidy up subchat integration
JegernOUTT Jun 11, 2025
26fcbb7
feat(chat): find the ancestors for the current end node
MarcMcIntosh Jun 11, 2025
36b6d34
refactor: rename getPathToEndNode to getAncestorsForNode
MarcMcIntosh Jun 11, 2025
8318437
first removing
JegernOUTT Jun 12, 2025
e4c462b
restore known_models.json
JegernOUTT Jun 12, 2025
b481f58
fix: wrong node shown when branching
MarcMcIntosh Jun 12, 2025
1ddf450
fix: branching from user message
MarcMcIntosh Jun 12, 2025
ce6829b
wip: branch button and removing old thread selectors.
MarcMcIntosh Jun 12, 2025
d00c7a8
ui: remove like and fix types.
MarcMcIntosh Jun 12, 2025
1189d84
feat: show usage for branch
MarcMcIntosh Jun 13, 2025
d925e67
fix: detect when streaming is done
MarcMcIntosh Jun 13, 2025
3467b53
fix: figure out if streaming or restoring, and fix some memoisation w…
MarcMcIntosh Jun 13, 2025
ead40a5
Add support for retrieving cloud tools in thread processing
JegernOUTT Jun 16, 2025
28d4995
ui: persist teams when in dev.
MarcMcIntosh Jun 16, 2025
95856e0
fix(alt): make sure alt numbers are unique for each branch
MarcMcIntosh Jun 16, 2025
7a2bc4b
chore: generate graphql
MarcMcIntosh Jun 16, 2025
d0839d0
fix(ui): waiting and streaming state for branches
MarcMcIntosh Jun 16, 2025
4262688
update create message mutations
MarcMcIntosh Jun 16, 2025
0d0cf49
Refactor tools execution to support cloud-based operations
JegernOUTT Jun 17, 2025
4c8c334
Refactor code to replace 'expert_name' with 'ft_fexp_id'
JegernOUTT Jun 17, 2025
1748459
Refactor threads processing and experts request code
JegernOUTT Jun 17, 2025
e605d7b
Refactor thread message processing to correct tool call retrieval
JegernOUTT Jun 17, 2025
037efac
Remove legacy code for model selection and streamline subchat logic
JegernOUTT Jun 17, 2025
5e9fa2c
Add tool_call_id parameter to subchat and refactor code
JegernOUTT Jun 17, 2025
057c89f
Fix query variable assignment by swapping ft_app
JegernOUTT Jun 17, 2025
5c1eec8
Handle tool execution errors without exiting process
JegernOUTT Jun 17, 2025
2fd35de
Filter cloud tools by tool permissions in threads processing
JegernOUTT Jun 17, 2025
6124a97
Add check for already answered tool calls in thread processing.
JegernOUTT Jun 17, 2025
acb6cff
Remove legacy cloud threads support from global_context and threads_s…
JegernOUTT Jun 17, 2025
79f1065
Add User-Agent header as "refact-lsp" in network requests.
JegernOUTT Jun 17, 2025
2b5271e
Implement GraphQL client and refactor API calls to use it
JegernOUTT Jun 17, 2025
7411c7a
feat(ui): stop thread button
MarcMcIntosh Jun 17, 2025
3304cbb
refactor(ui): fix types and rename history.graphql to flexus.graphql
MarcMcIntosh Jun 17, 2025
c9989bf
Add confirmation handling for tool calls
JegernOUTT Jun 18, 2025
48833f2
Update assistant message retrieval logic in tool_locate_search.rs
JegernOUTT Jun 18, 2025
f72452f
Remove unused ChatUsage and api_key, handle thread completion
JegernOUTT Jun 18, 2025
9f2c936
Remove legacy subchat and model handling code
JegernOUTT Jun 18, 2025
1e0e793
Merge remote-tracking branch 'origin/threads-graphql' into dev-flexus…
JegernOUTT Jun 18, 2025
7ee6a05
feat(ui): select expert (replaces system prompt)
MarcMcIntosh Jun 18, 2025
bfd7247
ui(model select): set model if not done by the user.
MarcMcIntosh Jun 18, 2025
22e23b7
feat(chat ui): add model select and restore when opening a chat.
MarcMcIntosh Jun 18, 2025
c08f076
wip(tools): add tools to thread when creating a thread.
MarcMcIntosh Jun 19, 2025
763660a
refactor: tools for group, don't cache multiple groups.
MarcMcIntosh Jun 19, 2025
b482c68
fix: missing deps in hook
MarcMcIntosh Jun 19, 2025
54b7853
Remove `@web` at-command and `ToolWeb`
JegernOUTT Jun 20, 2025
6ef9ece
Prevent duplicate entries in required_confirmation when already waiting
JegernOUTT Jun 20, 2025
347dc71
Remove unused hashing functionality in global_context.rs
JegernOUTT Jun 20, 2025
e07c927
Merge branch 'dev-flexus-migration' into threads-graphql
MarcMcIntosh Jun 20, 2025
a8e84aa
fix: add tools to `ftm_user_prefrences`
MarcMcIntosh Jun 20, 2025
2a4376d
chore: remove `v1/caps`
MarcMcIntosh Jun 20, 2025
27223da
chore(ui): remove system prompt code
MarcMcIntosh Jun 20, 2025
9d076eb
chore: remove history slice
MarcMcIntosh Jun 20, 2025
944b33e
wip: render tool results (still to do diffs).
MarcMcIntosh Jun 24, 2025
088b3ee
Merge branch 'oleg_flexus' into threads-graphql
MarcMcIntosh Jun 24, 2025
6aef0b9
chore: fix types
MarcMcIntosh Jun 24, 2025
fd7cbd1
fix: streaming
MarcMcIntosh Jun 24, 2025
a8d7738
fix: waiting streaming animation.
MarcMcIntosh Jun 24, 2025
cad3e44
feat: add new account link & beautified UI of group selection
alashchev17 Jun 24, 2025
6801a21
fix: adjusted layout for no associated accounts
alashchev17 Jun 24, 2025
c069a45
docs: unify and improve BYOK documentation as 'Configure Providers (B…
Jun 24, 2025
7e6a46a
merge fix
olegklimov Jun 26, 2025
5673072
Remove unnecessary knowledge and memory management code
JegernOUTT Jun 26, 2025
50f4123
Implement get_app_searchable_id function for macOS to retrieve machin…
JegernOUTT Jun 26, 2025
ff191c3
Add logging for active group ID change in workspace router
JegernOUTT Jun 26, 2025
581246c
Remove resolve_chat_model function and tokenizer dependencies
JegernOUTT Jun 26, 2025
dcc9fdc
Add tracing logs for debugging and remove unused test imports
JegernOUTT Jun 26, 2025
c3b5dc8
Refactor `count_tokens` to `count_text_tokens_with_tokenizer` for cla…
JegernOUTT Jun 26, 2025
783f00b
Remove obsolete sync_files feature from v1 routers module
JegernOUTT Jun 26, 2025
6e850d8
Merge pull request #845 from smallcloudai/dev-fixes
JegernOUTT Jun 26, 2025
c0afb0c
ci(ui): disable tests and install optional dep
MarcMcIntosh Jun 26, 2025
52f299c
chore: run format.
MarcMcIntosh Jun 26, 2025
6fed1c6
Switch to fancy-regex for better regex handling
JegernOUTT Jun 26, 2025
6264970
Handle wildcard in ft_confirmation_response for tool calls
JegernOUTT Jun 26, 2025
926b6b8
Merge pull request #847 from smallcloudai/moar-fixes-dev
JegernOUTT Jun 26, 2025
5e771d6
wip: wording
alashchev17 Jun 26, 2025
dbb5d57
wip: wording 2
alashchev17 Jun 26, 2025
bfdd7df
fix: rollup optional deps
alashchev17 Jun 26, 2025
68651d1
fix: installed all @rollup related packages with --save-optional
alashchev17 Jun 26, 2025
def4d18
fix: types/linting issues
alashchev17 Jun 26, 2025
8c61627
review code oleg & sergey
olegklimov Jun 27, 2025
f47b9a8
the fix
JegernOUTT Jun 27, 2025
0564bb8
Merge pull request #853 from smallcloudai/thread-id-fix
JegernOUTT Jun 27, 2025
5e91e33
store .refact directories on global context
MDario123 Jun 18, 2025
c6e6d34
use .refact dirs in get_config_dirs
MDario123 Jun 18, 2025
19f3fa0
update .refact dirs using the watcher
MDario123 Jun 18, 2025
a547fd9
small refactors
MDario123 Jun 18, 2025
9c96180
faster and async read_integrations_d
MDario123 Jun 18, 2025
239c80c
fix: delete debug test
MDario123 Jun 18, 2025
483be8c
fix: avoid unnecesary lock twice in a row
MDario123 Jun 24, 2025
4b5b1f0
refactor: on .refact dir change simplify logic
MDario123 Jun 24, 2025
d4a8843
refactor: delete trivial comment
MDario123 Jun 24, 2025
a36ae02
chore: disable login
MarcMcIntosh Jul 3, 2025
49521dc
fix: handle ssl addresses. (#860)
MarcMcIntosh Jul 4, 2025
88c9185
Tool confirmation (#844)
MarcMcIntosh Jul 7, 2025
3069056
chore: remove telemetry (#861)
MarcMcIntosh Jul 7, 2025
453cd52
fix: disable login
MarcMcIntosh Jul 7, 2025
d5da095
Unify urql (#863)
MarcMcIntosh Jul 9, 2025
050adf5
Connection status (#864)
MarcMcIntosh Jul 11, 2025
c0b9424
fix: balance updated with with usage
MarcMcIntosh Jul 11, 2025
6ad8732
chore: remove unused imports.
MarcMcIntosh Jul 11, 2025
6d7145e
small fixes (#865)
MarcMcIntosh Jul 14, 2025
fae3c47
UI view raw thread (#873)
MarcMcIntosh Jul 14, 2025
6d2990c
update jb troubleshooting
mitya52 Jul 14, 2025
d97e1fc
ci: trigger build
MarcMcIntosh Jul 15, 2025
5a931a3
ci: remove file added to trigger build
MarcMcIntosh Jul 15, 2025
3c8a614
add workflow_dispatch to gui workflow
reymondzzzz Jul 15, 2025
d95460e
Text doc update plus storybook (#886)
MarcMcIntosh Jul 16, 2025
e012bcb
Update types (#887)
MarcMcIntosh Jul 23, 2025
cccf477
quickfix
olegklimov Jul 24, 2025
10e9cc0
Enable images (#888)
MarcMcIntosh Jul 25, 2025
2f41d6f
Fixes 25 07 25 (#890)
MarcMcIntosh Jul 30, 2025
51a2336
Security Patch: add missing PreventDefault() in form to stop circumna…
nat-leo Sep 17, 2025
335af3f
Coins fix (#898)
MarcMcIntosh Sep 19, 2025
0076014
chore: remove old agent usage buttons (#900)
MarcMcIntosh Sep 19, 2025
ff07d9c
if hasError it doesn't block chat history
JegernOUTT Nov 27, 2025
2e476cc
postProcessMessagesAfterStreaming
JegernOUTT Nov 27, 2025
ca17ace
deduplicateToolCalls
JegernOUTT Nov 27, 2025
3fced87
update_textdoc_by_lines
JegernOUTT Nov 27, 2025
3056051
model selector in the middle of a thread
JegernOUTT Nov 27, 2025
555f90f
fixed all npm errors
JegernOUTT Nov 27, 2025
33b80aa
Fix CI build: use npm install instead of npm ci
JegernOUTT Dec 3, 2025
032805c
Fix localStorage tests: add undefined check
JegernOUTT Dec 3, 2025
bbc3204
Add localStorage mock for tests
JegernOUTT Dec 3, 2025
38774b8
Fix localStorage function check in storage.ts
JegernOUTT Dec 3, 2025
e342956
Fix code formatting with Prettier
JegernOUTT Dec 3, 2025
55c70e9
Fix TypeScript error in localStorage mock
JegernOUTT Dec 3, 2025
7a1221f
Merge pull request #910 from smallcloudai/sergei-fixes-cvox
JegernOUTT Dec 3, 2025
355657d
Merge pull request #814 from smallcloudai/gwen
JegernOUTT Dec 3, 2025
922c2cb
better model selection
JegernOUTT Dec 8, 2025
b3830eb
include_project_info, context_tokens_cap
JegernOUTT Dec 8, 2025
b7757c9
include_project_info, context_tokens_cap
JegernOUTT Dec 8, 2025
c1ad8cf
button to resend the last messages
JegernOUTT Dec 8, 2025
675b4d0
state.thread.model = action.payload;
JegernOUTT Dec 8, 2025
a0d22a5
fix: remove 'Try Again' buttons from error UI and fix prettier format…
JegernOUTT Dec 8, 2025
70b4810
Merge pull request #911 from smallcloudai/grouped-models-with-prices
JegernOUTT Dec 8, 2025
863bbb2
feat(gui): fix double scrollbar, add coins display, improve token stats
JegernOUTT Dec 11, 2025
ca2bdeb
rm unnecessary things
JegernOUTT Dec 11, 2025
25ae12f
fix: apply prettier formatting to GUI files
JegernOUTT Dec 11, 2025
c293843
Merge pull request #912 from smallcloudai/grouped-models-with-prices
JegernOUTT Dec 11, 2025
fa791b3
fix: improve usage counter layout and prevent text overlap
JegernOUTT Dec 15, 2025
871a46d
Merge pull request #913 from smallcloudai/fix/usage-counter-layout
JegernOUTT Dec 15, 2025
7c28e1a
DEFAULT_MAX_NEW_TOKENS = null
JegernOUTT Dec 15, 2025
33fef46
fix: remove DEFAULT_MAX_NEW_TOKENS reset to preserve model context fr…
JegernOUTT Dec 15, 2025
967e347
style: fix formatting in useCapsForToolUse.ts
JegernOUTT Dec 15, 2025
2434dd7
feat(chat): add message queue for sending during streaming
JegernOUTT Dec 16, 2025
a43114c
feat(chat): render markdown in tool outputs with consistent typography
JegernOUTT Dec 16, 2025
95e1f29
chore: add developer documentation and UI layout improvements
JegernOUTT Dec 16, 2025
17f5229
fix: remove extra padding from ResendButton/LikeButton that caused in…
JegernOUTT Dec 16, 2025
659b44a
feat: use standard Markdown component for tool outputs
JegernOUTT Dec 16, 2025
4c832c2
fix: position retry/like buttons to the right side
JegernOUTT Dec 16, 2025
8bdb18d
Rename 'Compress chat and continue' to 'Summarize and continue in a n…
JegernOUTT Dec 16, 2025
7a6c5d3
Remove line numbers from context files and MCP logs code blocks
JegernOUTT Dec 16, 2025
97e2c7c
chore: lint/format/type check - fix prefer-includes lint error
JegernOUTT Dec 16, 2025
748f168
Merge pull request #915 from smallcloudai/feature/queued-messages
JegernOUTT Dec 16, 2025
9ddb84a
style: format code with prettier
JegernOUTT Dec 16, 2025
0984b27
Merge pull request #914 from smallcloudai/feature/markdown-in-tool-ou…
JegernOUTT Dec 16, 2025
1c1f6ee
Replace thumbs up button with save button and fix tooltip consistency
JegernOUTT Dec 17, 2025
26072f2
Merge branch 'main' into dev
JegernOUTT Dec 23, 2025
b6aa940
Merge branch 'main-stable' into dev
JegernOUTT Dec 23, 2025
a748788
chore: sync gui from main-stable and engine from main
JegernOUTT Dec 23, 2025
fb9ac78
chore: remove gui files not in main-stable
JegernOUTT Dec 23, 2025
7076d3c
chore: restore Login feature from main-stable
JegernOUTT Dec 23, 2025
0702006
chore: remove engine files not in main
JegernOUTT Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/agent_gui_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
push:
branches: [main, dev]
paths:
- 'refact-agent/gui/**'
- '.github/workflows/agent_gui_*'
- "refact-agent/gui/**"
- ".github/workflows/agent_gui_*"
pull_request:
paths:
- 'refact-agent/gui/**'
- '.github/workflows/agent_gui_*'
- "refact-agent/gui/**"
- ".github/workflows/agent_gui_*"
workflow_dispatch:

defaults:
Expand All @@ -31,16 +31,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: "npm"
cache-dependency-path: refact-agent/gui/package-lock.json

# Disable Husky install during npm ci
# Disable Husky install during npm install --prefer-offline
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev
npm pkg delete scripts.prepare
npm ci
npm install --prefer-offline

- run: npm run test
- run: npm run format:check
Expand Down
14 changes: 7 additions & 7 deletions docs/.astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,6 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/usage-based-pricing.md": {
id: "guides/usage-based-pricing.md";
slug: "guides/usage-based-pricing";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"guides/version-specific/enterprise/getting-started.md": {
id: "guides/version-specific/enterprise/getting-started.md";
slug: "guides/version-specific/enterprise/getting-started";
Expand Down Expand Up @@ -500,6 +493,13 @@ declare module 'astro:content' {
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"introduction/usage-based-pricing.md": {
id: "introduction/usage-based-pricing.md";
slug: "introduction/usage-based-pricing";
body: string;
collection: "docs";
data: InferEntrySchema<"docs">
} & { render(): Render[".md"] };
"privacy.md": {
id: "privacy.md";
slug: "privacy";
Expand Down
4 changes: 2 additions & 2 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ export default defineConfig({
}
},
{
label: 'BYOK',
label: 'Configure Providers (BYOK)',
link: '/byok/',
attrs: {
'aria-label': 'Learn about Bring Your Own Key (BYOK)'
'aria-label': 'Configure Providers (BYOK) documentation'
}
},
{
Expand Down
Binary file removed docs/src/assets/byok.png
Binary file not shown.
Binary file removed docs/src/assets/byok_login_start.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 106 additions & 13 deletions docs/src/content/docs/byok.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,115 @@
---
title: "Bring Your Own Key (BYOK)"
title: "Configure Providers (BYOK)"
description: "How to use Bring Your Own Key (BYOK) to connect your own API keys and models in Refact."
---

## Introduction
# Introduction

Bring Your Own Key (BYOK) allows users to specify their API keys and select models for chat, completion, and embedding tasks across different AI platforms. This feature enables seamless integration with various services while maintaining control over API keys.
The **Configure Providers** feature (also known as BYOK – Bring Your Own Key) allows you to connect your own API keys for supported AI providers, giving you full control over which models you use and how you are billed.

## How to Switch Providers in the Plugin
---

## What is "Configure Providers" (BYOK)?

- **Bring Your Own Key (BYOK)** lets you use your own API keys for services like OpenAI, Anthropic, DeepSeek, and others, instead of (or in addition to) Refact’s built-in cloud models.
- This is ideal if you have your own API access, want to use specific models, or need to keep billing and data usage under your own account.

---

## Supported Providers

You can connect API keys for:
- **OpenAI** (e.g., GPT-3.5, GPT-4, GPT-4o, etc.)
- **Anthropic** (e.g., Claude models)
- **DeepSeek** (e.g., deepseek-chat, deepseek-reasoner)
- **Local models** (if supported by your Refact instance)
- Other providers as they become available

---

## How to Configure Providers (Step-by-Step)

### 1. Open the Providers Menu

- In the Refact plugin, click the menu button (three horizontal lines or "burger" icon) in the top right corner.
- Select **Configure Providers** from the dropdown menu.

![Configure Providers Menu](../../assets/configure_providers/configure_providers_menu.png)

---

### 2. Add a New Provider

- In the **Configure Providers** window, click **Add Provider** or the "+" button.
- Choose your provider from the list (e.g., OpenAI, Anthropic, DeepSeek).

![Choose Provider](../../assets/configure_providers/choose_provider.png)

---

### 3. Enter Your API Key and Configure Provider Settings

- Paste your API key into the field provided.
- (Optional) Give the provider a custom name for easy identification.
- Enable or disable the provider as needed.
- Click **Save**.

![Provider Configuration](../../assets/configure_providers/provider_configuration.png)

By default, your provider is Refact.ai Cloud. If you want to switch from it, follow these steps:
---

### 4. Configure Models for Each Provider

- For each provider, you can add and configure models for the tasks that provider supports (such as **Chat**, **Completion**, or **Embeddings**).
- The available model types and settings will depend on the provider you select.
- Click **Add model** to open the model configuration dialog.

![Chat Model Configuration Dialog](../../assets/configure_providers/chat_model_configuration_dialog.png)

![Completion Model Configuration Dialog](../../assets/configure_providers/completion_model_configuration_dialog.png)

#### Model Configuration Fields
- **Name**: The model’s name/ID (e.g., `gpt-4o`, `deepseek-chat`).
- **Context Window (n_ctx)**: Maximum context length (tokens) the model can handle.
- **Tokenizer**: The tokenizer to use (e.g., `hf://` for HuggingFace models).
- **Default Temperature**: Controls randomness/creativity of model outputs.
- **Reasoning Style**: (Dropdown) Choose a reasoning style, if supported.
- **Capabilities**: Select which features the model supports (Tools, Multimodality, Clicks, Agent, etc.).

---

### 5. Switch Between Providers and Models

- You can add multiple providers and models, and switch between them at any time.
- The currently active provider/model will be used for new requests.

---

1. Navigate to the "Burger" button in the right upper corner of the plugin interface and click it.
2. Go to the "Configure providers" tab and click it.<br>
<img src="../../assets/byok_1.png" alt="Configure providers tab" style="max-height:33vh; display:block; margin:1em 0; border:3px solid #e74c3c; border-radius:8px;">
3. Choose the provider you want to add from the list.<br>
<img src="../../assets/byok_2.png" alt="Choose provider" style="max-height:33vh; display:block; margin:1em 0; border:3px solid #e74c3c; border-radius:8px;">
4. You can enable or disable providers and delete them if needed.
## Billing and Usage

## Additional Resources
- **When using BYOK, your requests are billed directly by the provider (e.g., OpenAI, Anthropic, DeepSeek).**
- **Refact coins are NOT consumed** for BYOK requests.
- You are responsible for monitoring your API usage and costs with your provider.

---

## Best Practices & Troubleshooting

- **Keep your API keys secure.** Never share them publicly.
- If a provider or model is not working, double-check your API key, model name, and account status.
- Some providers may have usage limits or require specific permissions.
- For help, visit our [Discord Community](https://smallcloud.ai/discord) or check the FAQ.

---

## FAQ

**Q: Can I use multiple providers at once?**
A: Yes! You can add and switch between multiple providers as needed.

**Q: What happens if my API key runs out of credit?**
A: Requests will fail until you add more credit or switch to another provider.

---

For more examples and configurations, please visit the [Refact GitHub repository](https://github.com/smallcloudai/refact-lsp/tree/main/bring_your_own_key).
For more help, see our [FAQ](/faq/) or contact support.
7 changes: 4 additions & 3 deletions docs/src/content/docs/introduction/usage-based-pricing.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ showDollarsBtn.onclick = () => setTable('dollars');
| Self-hosting option available | |
| Discord support | |

## Bring Your Own Key (BYOK)
## Configure Providers (BYOK)

If you prefer to use your own API key (for OpenAI, Anthropic, or local models), you can connect it to Refact.ai. When using BYOK, requests are billed by your provider and do not consume Refact.ai coins.
Refact.ai allows you to connect your own API keys for OpenAI, Anthropic, DeepSeek, and other providers using the **Configure Providers** feature (also known as BYOK – Bring Your Own Key). This gives you full control over which models you use and how you are billed.

**No commission:** For now, Refact.ai does not take any commission or markup on API usage. You pay only for the actual API cost of the model you use.

For more information on how to use Bring Your Own Key (BYOK), see the [BYOK documentation](https://github.com/smallcloudai/refact/blob/main/docs/byok.md) in the repository.
For a step-by-step guide on setting up and using this feature, see the [Configure Providers (BYOK) documentation](/byok/).

Loading