llm_link/apps/
zed.rs

1use crate::settings::{
2    Settings, ServerSettings, LlmBackendSettings, ApiSettings,
3    OpenAiApiSettings, OllamaApiSettings, AnthropicApiSettings,
4    ClientAdapterSettings, ZedAdapterSettings,
5};
6/// Zed.dev application configuration
7pub struct ZedApp;
8
9impl ZedApp {
10    /// Generate Zed.dev configuration
11    pub fn generate_config() -> Settings {
12        Settings {
13            server: ServerSettings {
14                host: "0.0.0.0".to_string(),
15                port: 11434,
16                log_level: "info".to_string(),
17            },
18            llm_backend: LlmBackendSettings::Ollama {
19                base_url: Some("http://localhost:11435".to_string()),
20                model: "llama2".to_string(),
21            },
22            apis: ApiSettings {
23                openai: Some(OpenAiApiSettings {
24                    enabled: false,  // Disabled by default - use --protocols openai to enable
25                    path: "/v1".to_string(),
26                    api_key_header: Some("Authorization".to_string()),
27                    api_key: None,
28                }),
29                ollama: Some(OllamaApiSettings {
30                    enabled: false,  // Disabled by default - use --protocols ollama to enable
31                    path: "".to_string(),  // Empty path so routes become /api/tags directly
32                    api_key_header: None,
33                    api_key: None,
34                }),
35                anthropic: Some(AnthropicApiSettings {
36                    enabled: false,
37                    path: "/anthropic".to_string(),
38                    api_key_header: None,
39                }),
40            },
41            client_adapters: Some(ClientAdapterSettings {
42                default_adapter: Some("zed".to_string()),
43                force_adapter: Some("zed".to_string()),
44                zed: Some(ZedAdapterSettings {
45                    enabled: true,
46                    force_images_field: Some(true),
47                    preferred_format: Some("ndjson".to_string()),
48                }),
49            }),
50        }
51    }
52}
53