Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 1.99 KB

File metadata and controls

66 lines (53 loc) · 1.99 KB

中文|En

什么是fcode?

  • fcode是为lsp-ai项目做的一个adapter,支持fitten code,cloudflare AI workers,以及其他兼容OpenAI接口的大模型API。例如,美团的LongCat,阿里的ModelScope(qwen),google的gemini,OpenAI等等。

fcode带来什么好处?

  • 原本不支持lsp-ai的fitten code可以在lsp-ai中使用。
  • 原本不支持的cloudflare AI workers也可以在lsp-ai中使用。
  • 在不同的Model/API之间快速无缝切换。
  • 支持为单个模型设置本地代理(对于国内用户友好)

使用方法

  • 编辑配置文件
mkdir -p ~/.fcode
cd ~/.fcode
touch conf.toml
# 复制conf_example/conf.toml 内容到上述文件,并修改username, password, key等等。可以根据自己的情况增减大模型配置。

fcode提供了哪些命令

fcode -h   
Usage:
   [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  list        List available model names.
  serve       Run server for lsp-ai.
  show        Show config file path.
  stop        Stop fcode server.
  use         Use an available model.

Flags:
  -h, --help   help for this command

Use " [command] --help" for more information about a command.

配置lsp-ai

# 见conf_example/helix_languages.toml

安装

go install github.com/gvcgo/fcode@latest
# 我个人更喜欢为helix设置命令别名,这样每次打开helix都能重启fcode:
# alias hx="fcode stop && fcode serve>/dev/null 2>&1 & ; hx"

开启本地服务

fcode stop && fcode serve>/dev/null 2>&1 &

Gallery

  • fitten code

    fitten

  • chat chat