Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7f2aba9
subchat model params and chat id fixes
mitya52 Jun 4, 2025
28ae2eb
remove locks of at commands and at command params
humbertoyusta May 20, 2025
2dda8a7
remove ast sled db lock
humbertoyusta May 20, 2025
327f562
fix: don't fully postprocess file for preview
humbertoyusta May 26, 2025
5eab584
fix: remove binary fields from source file extensions, .db .sqlite .u…
humbertoyusta May 27, 2025
3172800
fix: only ask for definitions if file is supported by ast
humbertoyusta May 27, 2025
174e26d
fix: remove unnecesary messages cloning
humbertoyusta May 27, 2025
f759866
update tree-sitter
humbertoyusta May 27, 2025
d7956a3
add how much did it take to build AST
humbertoyusta May 28, 2025
4bec6ff
migrating to lmdb: step 1
humbertoyusta May 28, 2025
61affa3
updating ast db to lmdb
humbertoyusta May 29, 2025
6b3ae63
fix: windows warning import
humbertoyusta May 30, 2025
deb55b7
fix: keep temp dir in ast struct, so it can be cleaned up at drop
humbertoyusta May 30, 2025
b4f39ee
new ast db usage fixes, tracing improvements and refactor usages
humbertoyusta May 30, 2025
42feca5
fix: language typos
humbertoyusta May 30, 2025
a7d5b57
fix: db env settings
humbertoyusta May 30, 2025
9dfdf5e
fix: rm mutex from at commands after conflict resolution
humbertoyusta Jun 2, 2025
b796e12
fix: small fixes from review
humbertoyusta Jun 4, 2025
e9c8a5b
feat: better wording & animated confirmation card & workspace name ma…
alashchev17 Jun 5, 2025
b090a89
tools improvements pack (#813)
mitya52 Jun 6, 2025
1d718b9
fix: wording & workspaces get graphql schema update
alashchev17 Jun 6, 2025
9925ffa
Merge pull request #811 from smallcloudai/feat/group-tree-improvements
alashchev17 Jun 6, 2025
22fe1cd
wip: refactored useIntegrations, got rid of formData handling
alashchev17 Jun 4, 2025
11583aa
refactor(tables): better data state management & prevention of endles…
alashchev17 Jun 5, 2025
2152b19
do not blacklist tools for agent mode (#818)
mitya52 Jun 9, 2025
ef6b6bb
feat: cleanup inactive shadow git repos
humbertoyusta Jun 3, 2025
4232caa
feat: add cleanup of old objects in active repos
humbertoyusta Jun 5, 2025
41bbc0d
fix: UI friendly error for restoring old checkpoint
humbertoyusta Jun 5, 2025
4d35424
add test for git cleanup, so that it removes blob objects and does no…
humbertoyusta Jun 5, 2025
0cce5c9
fix: remove shadow git repos in two steps, first rename, then remove
humbertoyusta Jun 6, 2025
0aeaad2
fix: update mtime each time a checkpoint is created, so that we can c…
humbertoyusta Jun 6, 2025
2458c7b
fix: add abort flag to git cleanup
humbertoyusta Jun 6, 2025
a72dc36
qwen thinking mode and some improvements on server side
mitya52 Jun 8, 2025
4c7362e
add qwen reasoning option
mitya52 Jun 8, 2025
de4f603
missed enable thinking
mitya52 Jun 8, 2025
b9a3006
add concurrency setup in UI
mitya52 Jun 9, 2025
a59042e
allowed nctx
mitya52 Jun 9, 2025
660e695
split thinking part
mitya52 Jun 9, 2025
a3a1a30
less args
mitya52 Jun 9, 2025
1f51d8d
repair invalid index and id for tool call stream
mitya52 Jun 10, 2025
7d5c77b
prettier
mitya52 Jun 10, 2025
f2f074a
<think> remove if need to patch
mitya52 Jun 10, 2025
d1b09a2
comment on logic change
mitya52 Jun 10, 2025
ce7fd60
fix: remove multiple from mandatory toolcall.function.arguments prope…
alashchev17 Jun 10, 2025
0d01c12
cloud with non-statc caps
mitya52 Jun 11, 2025
f987f31
docs: unify and improve BYOK documentation as 'Configure Providers (B…
Jun 24, 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 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/).

4 changes: 2 additions & 2 deletions docs/src/content/docs/supported-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ For select models, click the `💡Think` button to enable advanced reasoning, he
- Qwen2.5-Coder-1.5B


## BYOK (Bring your own key)
## Configure Providers (BYOK)

Refact.ai gives flexibility to connect your API key and use any external LLM like Gemini, Grok, OpenAI, Deepseek, and others. Read the guide in our [BYOK Documentation](https://docs.refact.ai/byok/).
Refact.ai gives you the flexibility to connect your own API key and use external LLMs like Gemini, Grok, OpenAI, DeepSeek, and others. For a step-by-step guide, see the [Configure Providers (BYOK) documentation](/byok/).


## Self-Hosted Version
Expand Down
19 changes: 10 additions & 9 deletions refact-agent/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lto = true

[package]
name = "refact-lsp"
version = "0.10.20"
version = "0.10.21"
edition = "2021"
build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -29,11 +29,13 @@ chrono = { version = "0.4.31", features = ["serde"] }
diff = "0.1.13"
dunce = "1.0.5"
dyn_partial_eq = "=0.1.2"
filetime = "0.2.25"
futures = "0.3"
git2 = "0.20.2"
glob = "0.3.1"
hashbrown = "0.15.2"
headless_chrome = "1.0.16"
heed = "0.22.0"
home = "0.5"
html2text = "0.12.5"
hyper = { version = "0.14", features = ["server", "stream"] }
Expand Down Expand Up @@ -69,7 +71,6 @@ shell-words = "1.1.0"
shell-escape = "0.1.5"
select = "0.6.0"
similar = "2.3.0"
sled = { version = "0.34", default-features = false, features = [] }
sqlite-vec = { version = "0.1.6" }
strip-ansi-escapes = "0.2.1"
strsim = "0.11.1"
Expand All @@ -86,13 +87,13 @@ tower-lsp = "0.20"
tracing = "0.1"
tracing-appender = "0.2.3"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
tree-sitter = "0.22"
tree-sitter-cpp = "0.22"
tree-sitter-java = "0.21"
tree-sitter-javascript = "0.21"
tree-sitter-python = "0.21"
tree-sitter-rust = "0.21"
tree-sitter-typescript = "0.21"
tree-sitter = "0.25"
tree-sitter-cpp = "0.23"
tree-sitter-java = "0.23"
tree-sitter-javascript = "0.23"
tree-sitter-python = "0.23"
tree-sitter-rust = "0.23"
tree-sitter-typescript = "0.23"
typetag = "0.2"
url = "2.4.1"
uuid = { version = "1", features = ["v4", "serde"] }
Expand Down
Loading
Loading