Repository: TabbyML/tabby
File: crates/http-api-bindings/src/completion/mod.rs (Rust)

Code before:
use openai::OpenAICompletionEngine;
use tabby_common::config::HttpModelConfig;
use tabby_inference::CompletionStream;

pub async fn create(model: &HttpModelConfig) -> Arc<dyn CompletionStream> {
    match model.kind.as_str() {
        "llama.cpp/completion" => {
            let engine = LlamaCppEngine::create(
                model
                    .api_endpoint
                    .as_deref()
                    .expect("api_endpoint is required"),
                model.api_key.clone(),
            );
            Arc::new(engine)
        }
        "ollama/completion" => ollama_api_bindings::create_completion(model).await,
        "mistral/completion" => {
            let engine = MistralFIMEngine::create(
                model.api_endpoint.as_deref(),
                model.api_key.clone(),
                model.model_name.clone(),
            );
            Arc::new(engine)
        }
        "openai/completion" | "openai/legacy_completion" => {
            let engine = OpenAICompletionEngine::create(
                model.model_name.clone(),
                model
                    .api_endpoint
                    .as_deref()
                    .expect("api_endpoint is required"),
                model.api_key.clone(),
                true,
            );
            Arc::new(engine)
        }
        "openai/legacy_completion_no_fim" => {
            let engine = OpenAICompletionEngine::create(
                model.model_name.clone(),
                model
                    .api_endpoint
                    .as_deref()
                    .expect("api_endpoint is required"),
                model.api_key.clone(),
                false,
            );
            Arc::new(engine)
        }
        unsupported_kind => panic!(
            "Unsupported model kind for http completion: {}",

Review comment (suggestion):
```suggestion
        "openai/legacy_completion" | "deepseek/completion" | "openai/completion" => {
```

Code after:
use openai::OpenAICompletionEngine;
use tabby_common::config::HttpModelConfig;
use tabby_inference::CompletionStream;

pub async fn create(model: &HttpModelConfig) -> Arc<dyn CompletionStream> {
    match model.kind.as_str() {
        "llama.cpp/completion" => {
            let engine = LlamaCppEngine::create(
                model
                    .api_endpoint
                    .as_deref()
                    .expect("api_endpoint is required"),
                model.api_key.clone(),
            );
            Arc::new(engine)
        }
        "ollama/completion" => ollama_api_bindings::create_completion(model).await,
        "mistral/completion" => {
            let engine = MistralFIMEngine::create(
                model.api_endpoint.as_deref(),
                model.api_key.clone(),
                model.model_name.clone(),
            );
            Arc::new(engine)
        }
        "openai/legacy_completion" | "openai/completion" | "deepseek/completion" => {
            let engine = OpenAICompletionEngine::create(
                model.model_name.clone(),
                model
                    .api_endpoint
                    .as_deref()
                    .expect("api_endpoint is required"),
                model.api_key.clone(),
                true,
            );
            Arc::new(engine)
        }
        "openai/legacy_completion_no_fim" | "vllm/completion" => {
            let engine = OpenAICompletionEngine::create(
                model.model_name.clone(),
                model
                    .api_endpoint
                    .as_deref()
                    .expect("api_endpoint is required"),
                model.api_key.clone(),
                false,
            );
            Arc::new(engine)
        }
        unsupported_kind => panic!(
            "Unsupported model kind for http completion: {}",